Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify raw lifetime cannot be certain keywords
  • Loading branch information
ehuss committed Nov 15, 2024
commit f04cd638be4ccc2a204bc5efd2842636e8ece084
4 changes: 2 additions & 2 deletions src/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ r[lex.token.life.syntax]
>    | RAW_LIFETIME
>
> RAW_LIFETIME :\
>    `'r#` [IDENTIFIER_OR_KEYWORD][identifier]
> &nbsp;&nbsp; `'r#` [IDENTIFIER_OR_KEYWORD][identifier] <sub>*Except `crate`, `self`, `super`, `Self`*</sub>
> _(not immediately followed by `'`)_

r[lex.token.life.intro]
Expand All @@ -779,7 +779,7 @@ r[lex.token.life.raw.intro]
A raw lifetime is like a normal lifetime, but its identifier is prefixed by `r#`. (Note that the `r#` prefix is not included as part of the actual lifetime.)

r[lex.token.life.raw.allowed]
Unlike a normal lifetime, a raw lifetime may be any strict or reserved keyword.
Unlike a normal lifetime, a raw lifetime may be any strict or reserved keyword except the ones listed above for `RAW_LIFETIME`.

> **Edition differences**: Raw lifetimes are accepted in the 2021
> edition or later. In earlier additions the token `'r#lt` is lexed as `'r # lt`.
Expand Down