@@ -769,6 +769,9 @@ r[lex.token.life.syntax]
769
769
> RAW_LIFETIME :\
770
770
>   ;  ; ` 'r# ` [ IDENTIFIER_OR_KEYWORD] [ identifier ] <sub >* Except ` crate ` , ` self ` , ` super ` , ` Self ` * </sub >
771
771
> _ (not immediately followed by ` ' ` )_
772
+ >
773
+ > RESERVED_RAW_LIFETIME : ` 'r#_ `
774
+ > _ (not immediately followed by ` ' ` )_
772
775
773
776
r[ lex.token.life.intro]
774
777
Lifetime parameters and [ loop labels] use LIFETIME_OR_LABEL tokens. Any
@@ -781,6 +784,9 @@ A raw lifetime is like a normal lifetime, but its identifier is prefixed by `r#`
781
784
r[ lex.token.life.raw.allowed]
782
785
Unlike a normal lifetime, a raw lifetime may be any strict or reserved keyword except the ones listed above for ` RAW_LIFETIME ` .
783
786
787
+ r[ lex.token.life.raw.reserved]
788
+ It is an error to use the RESERVED_RAW_LIFETIME token ` 'r#_ ` in order to avoid confusion with the [ placeholder lifetime] .
789
+
784
790
r[ lex.token.life.raw.edition2021]
785
791
> ** Edition differences** : Raw lifetimes are accepted in the 2021
786
792
> edition or later. In earlier additions the token ` 'r#lt ` is lexed as ` 'r # lt ` .
@@ -946,6 +952,7 @@ r[lex.token.reserved-prefix.edition2021]
946
952
[numeric types]: types/ numeric. md
947
953
[paths]: paths. md
948
954
[patterns]: patterns. md
955
+ [placeholder lifetime]: lifetime- elision. md
949
956
[question]: expressions/ operator- expr. md#the- question- mark- operator
950
957
[range]: expressions/ range- expr. md
951
958
[rangepat]: patterns. md#range- patterns
0 commit comments