@@ -66,7 +66,12 @@ pub enum TokenKind {
6666 Ident ,
6767 /// "r#ident"
6868 RawIdent ,
69- /// `foo#`, `foo'`, `foo"`. Note the tailer is not included.
69+ /// An unknown prefix like `foo#`, `foo'`, `foo"`. Note that only the
70+ /// prefix (`foo`) is included in the token, not the separator (which is
71+ /// lexed as its own distinct token). In Rust 2021 and later, reserved
72+ /// prefixes are reported as errors; in earlier editions, they result in a
73+ /// (allowed by default) lint, and are treated as regular identifier
74+ /// tokens.
7075 BadPrefix ,
7176 /// "12_u8", "1.0e-40", "b"123"". See `LiteralKind` for more details.
7277 Literal { kind : LiteralKind , suffix_start : usize } ,
@@ -493,7 +498,7 @@ impl Cursor<'_> {
493498 debug_assert ! ( is_id_start( self . prev( ) ) ) ;
494499 // Start is already eaten, eat the rest of identifier.
495500 self . eat_while ( is_id_continue) ;
496- // Good prefixes must have been handled eariler . So if
501+ // Good prefixes must have been handled earlier . So if
497502 // we see a prefix here, it is definitely a bad prefix.
498503 match self . first ( ) {
499504 '#' | '"' | '\'' => BadPrefix ,
0 commit comments