Skip to content

Commit ba3ca44

Browse files
authored
Merge pull request #1668 from ehuss/label-pre-expansion
Update lifetimes for pre-expansion validation
2 parents da0f6da + 56405a3 commit ba3ca44

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/items/generics.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ r[items.generics.syntax]
1212
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup> ( _LifetimeParam_ | _TypeParam_ | _ConstParam_ )
1313
>
1414
> _LifetimeParam_ :\
15-
> &nbsp;&nbsp; [LIFETIME_OR_LABEL]&nbsp;( `:` [_LifetimeBounds_] )<sup>?</sup>
15+
> &nbsp;&nbsp; [_Lifetime_]&nbsp;( `:` [_LifetimeBounds_] )<sup>?</sup>
1616
>
1717
> _TypeParam_ :\
1818
> &nbsp;&nbsp; [IDENTIFIER]&nbsp;( `:` [_TypeParamBounds_]<sup>?</sup> )<sup>?</sup> ( `=` [_Type_] )<sup>?</sup>
@@ -54,8 +54,8 @@ r[items.generics.builtin-generic-types]
5454
[function pointers] have lifetime or type parameters as well, but are not
5555
referred to with path syntax.
5656

57-
r[items.generics.wildcard-lifetime]
58-
`'_` is not a valid lifetime parameter.
57+
r[items.generics.invalid-lifetimes]
58+
`'_` and `'_static` are not valid lifetime parameters.
5959

6060
### Const generics
6161

@@ -294,7 +294,6 @@ struct Foo<#[my_flexible_clone(unbounded)] H> {
294294
```
295295

296296
[IDENTIFIER]: ../identifiers.md
297-
[LIFETIME_OR_LABEL]: ../tokens.md#lifetimes-and-loop-labels
298297

299298
[_ForLifetimes_]: ../trait-bounds.md#higher-ranked-trait-bounds
300299
[_LifetimeParam_]: #generic-parameters

src/tokens.md

-2
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,6 @@ r[lex.token.life.syntax]
762762
>
763763
> LIFETIME_OR_LABEL :\
764764
> &nbsp;&nbsp; &nbsp;&nbsp; `'` [NON_KEYWORD_IDENTIFIER][identifier]
765-
> _(not immediately followed by `'`)_\
766-
> &nbsp;&nbsp; | `'_`
767765
> _(not immediately followed by `'`)_
768766
769767
r[lex.token.life.intro]

src/trait-bounds.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ r[bound.syntax]
2121
>
2222
> _Lifetime_ :\
2323
> &nbsp;&nbsp; &nbsp;&nbsp; [LIFETIME_OR_LABEL]\
24-
> &nbsp;&nbsp; | `'static`
24+
> &nbsp;&nbsp; | `'static`\
25+
> &nbsp;&nbsp; | `'_`
2526
>
2627
> _UseBound_ :\
2728
> &nbsp;&nbsp; `use` _UseBoundGenericArgs_

0 commit comments

Comments
 (0)