@@ -104,6 +104,12 @@ pub enum TokenKind {
104104 /// for emoji identifier recovery, as those are not meant to be ever accepted.
105105 InvalidPrefix ,
106106
107+ /// Guarded string literal prefix: `#"` or `##`.
108+ ///
109+ /// Used for reserving "guarded strings" (RFC 3598) in edition 2024.
110+ /// Split into the component tokens on older editions.
111+ GuardedStrPrefix ,
112+
107113 /// Examples: `12u8`, `1.0e-40`, `b"123"`. Note that `_` is an invalid
108114 /// suffix, but may be present here on string and float literals. Users of
109115 /// this type will need to check for and reject that case.
@@ -205,11 +211,6 @@ pub enum LiteralKind {
205211 ByteStr { terminated : bool } ,
206212 /// `c"abc"`, `c"abc`
207213 CStr { terminated : bool } ,
208- /// Guarded string literal prefix: `#"` or `##`.
209- ///
210- /// Used for reserving "guarded strings" (RFC 3598) in edition 2024.
211- /// Split into the component tokens on older editions.
212- GuardedStrPrefix ,
213214 /// `r"abc"`, `r#"abc"#`, `r####"ab"###"c"####`, `r#"a`. `None` indicates
214215 /// an invalid literal.
215216 RawStr { n_hashes : Option < u8 > } ,
@@ -422,8 +423,7 @@ impl Cursor<'_> {
422423 // Guarded string literal prefix: `#"` or `##`
423424 '#' if matches ! ( self . first( ) , '"' | '#' ) => {
424425 self . bump ( ) ;
425- let suffix_start = self . pos_within_token ( ) ;
426- TokenKind :: Literal { kind : GuardedStrPrefix , suffix_start }
426+ TokenKind :: GuardedStrPrefix
427427 }
428428
429429 // One-symbol tokens.
0 commit comments