Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize Style Guide Entry for Precise Capture Syntax #138527

Open
ytmimi opened this issue Mar 15, 2025 · 0 comments
Open

Stabilize Style Guide Entry for Precise Capture Syntax #138527

ytmimi opened this issue Mar 15, 2025 · 0 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. F-precise_capturing `#![feature(precise_capturing)]` T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. T-style Relevant to the style team, which will review and decide on the PR/issue.

Comments

@ytmimi
Copy link
Contributor

ytmimi commented Mar 15, 2025

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.

@ytmimi ytmimi added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Mar 15, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 15, 2025
@jieyouxu jieyouxu added T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. T-style Relevant to the style team, which will review and decide on the PR/issue. C-bug Category: This is a bug. F-precise_capturing `#![feature(precise_capturing)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. F-precise_capturing `#![feature(precise_capturing)]` T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. T-style Relevant to the style team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants