@@ -66,7 +66,12 @@ pub enum TokenKind {
66
66
Ident ,
67
67
/// "r#ident"
68
68
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.
70
75
BadPrefix ,
71
76
/// "12_u8", "1.0e-40", "b"123"". See `LiteralKind` for more details.
72
77
Literal { kind : LiteralKind , suffix_start : usize } ,
@@ -493,7 +498,7 @@ impl Cursor<'_> {
493
498
debug_assert ! ( is_id_start( self . prev( ) ) ) ;
494
499
// Start is already eaten, eat the rest of identifier.
495
500
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
497
502
// we see a prefix here, it is definitely a bad prefix.
498
503
match self . first ( ) {
499
504
'#' | '"' | '\'' => BadPrefix ,
0 commit comments