Skip to content

Commit cc4df3e

Browse files
authored
Merge pull request #1532 from ehuss/keyword-lifetimes
Add '_ to LIFETIME_OR_LABEL
2 parents f06bafd + 9fd0533 commit cc4df3e

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

src/expressions/loop-expr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ Labels follow the hygiene and shadowing rules of local variables. For example, t
209209
}
210210
```
211211

212+
`'_` is not a valid loop label.
213+
212214
## `break` expressions
213215

214216
> **<sup>Syntax</sup>**\

src/items/generics.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ See [generic parameter scopes] for more details.
4444
[function pointers] have lifetime or type parameters as well, but are not
4545
referred to with path syntax.
4646

47+
`'_` is not a valid lifetime parameter.
48+
4749
### Const generics
4850

4951
*Const generic parameters* allow items to be generic over constant values. The

src/tokens.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ Examples of reserved forms:
645645
>
646646
> LIFETIME_OR_LABEL :\
647647
> &nbsp;&nbsp; &nbsp;&nbsp; `'` [NON_KEYWORD_IDENTIFIER][identifier]
648+
> _(not immediately followed by `'`)_\
649+
> &nbsp;&nbsp; | `'_`
648650
> _(not immediately followed by `'`)_
649651
650652
Lifetime parameters and [loop labels] use LIFETIME_OR_LABEL tokens. Any

src/trait-bounds.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
>
1919
> _Lifetime_ :\
2020
> &nbsp;&nbsp; &nbsp;&nbsp; [LIFETIME_OR_LABEL]\
21-
> &nbsp;&nbsp; | `'static`\
22-
> &nbsp;&nbsp; | `'_`
21+
> &nbsp;&nbsp; | `'static`
2322
2423
[Trait] and lifetime bounds provide a way for [generic items][generic] to
2524
restrict which types and lifetimes are used as their parameters. Bounds can be

0 commit comments

Comments
 (0)