Skip to content

Stabilize Style Guide Entry for Precise Capture Syntax #138527

Closed
@ytmimi

Description

@ytmimi
Contributor

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.

Activity

added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Mar 15, 2025
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Mar 15, 2025
added
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.
C-bugCategory: This is a bug.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Mar 15, 2025
xizheyin

xizheyin commented on Apr 7, 2025

@xizheyin
Contributor

@rustbot claim

added a commit that references this issue on May 7, 2025

Rollup merge of rust-lang#139518 - xizheyin:issue-138527, r=traviscross

d396619
added a commit that references this issue on May 7, 2025
7d18d73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Participants

    @ytmimi@jieyouxu@rustbot@xizheyin

    Issue actions

      Stabilize Style Guide Entry for Precise Capture Syntax · Issue #138527 · rust-lang/rust