Rollup merge of #139518 - xizheyin:issue-138527, r=traviscross
Stabilize precise capture syntax in style guide Closes #138527 r? `@jieyouxu`
This commit is contained in:
commit
d396619af0
2 changed files with 12 additions and 12 deletions
|
|
@ -5,15 +5,3 @@ This chapter documents style and formatting for nightly-only syntax. The rest of
|
|||
Style and formatting for nightly-only syntax should be removed from this chapter and integrated into the appropriate sections of the style guide at the time of stabilization.
|
||||
|
||||
There is no guarantee of the stability of this chapter in contrast to the rest of the style guide. Refer to the style team policy for nightly formatting procedure regarding breaking changes to this chapter.
|
||||
|
||||
### `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> {}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -59,3 +59,15 @@ Box<
|
|||
+ Debug
|
||||
>
|
||||
```
|
||||
|
||||
## Precise capturing bounds
|
||||
|
||||
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`.
|
||||
|
||||
```rust
|
||||
fn foo() -> impl Sized + use<'a> {}
|
||||
|
||||
// is formatted analogously to:
|
||||
|
||||
fn foo() -> impl Sized + Use<'a> {}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue