Skip to content

Stabilize Style Guide Entry for Precise Capture Syntax #138527

Closed
@ytmimi

Description

@ytmimi

Location

### `feature(precise_capturing)`
A `use<'a, T>` precise capturing bound is formatted as if it were a single path segment with non-turbofished angle-bracketed args, like a trait bound whose identifier is `use`.
```
fn foo() -> impl Sized + use<'a> {}
// is formatted analogously to:
fn foo() -> impl Sized + Use<'a> {}
```

Summary

I believe that precise capturing (#123432) was stabilized, but it's still listed as a nightly-only feature in the style guide.

### `feature(precise_capturing)`
A `use<'a, T>` precise capturing bound is formatted as if it were a single path segment with non-turbofished angle-bracketed args, like a trait bound whose identifier is `use`.
```
fn foo() -> impl Sized + use<'a> {}
// is formatted analogously to:
fn foo() -> impl Sized + Use<'a> {}
```

I think these docs should be moved to a stable section. Also, rust-lang/rustfmt#6504, was recently filed and I'm wondering if t-style had any recommendations for sorting the precise capture syntax in a list of bounds.

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.F-precise_capturing`#![feature(precise_capturing)]`T-rustfmtRelevant to the rustfmt team, which will review and decide on the PR/issue.T-styleRelevant to the style team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions