@@ -201,28 +201,28 @@ impl<'a> StringReader<'a> {
201
201
self . cook_doc_comment ( content_start, content, CommentKind :: Block , doc_style)
202
202
}
203
203
rustc_lexer:: TokenKind :: Whitespace => return None ,
204
- rustc_lexer:: TokenKind :: Ident
205
- | rustc_lexer:: TokenKind :: RawIdent
206
- | rustc_lexer:: TokenKind :: UnknownPrefix => {
207
- let is_raw_ident = token == rustc_lexer:: TokenKind :: RawIdent ;
208
- let is_unknown_prefix = token == rustc_lexer:: TokenKind :: UnknownPrefix ;
209
- let mut ident_start = start;
210
- if is_raw_ident {
211
- ident_start = ident_start + BytePos ( 2 ) ;
212
- }
213
- if is_unknown_prefix {
214
- self . report_unknown_prefix ( start) ;
215
- }
216
- let sym = nfc_normalize ( self . str_from ( ident_start) ) ;
204
+ rustc_lexer:: TokenKind :: Ident => {
205
+ let sym = nfc_normalize ( self . str_from ( start) ) ;
217
206
let span = self . mk_sp ( start, self . pos ) ;
218
207
self . sess . symbol_gallery . insert ( sym, span) ;
219
- if is_raw_ident {
220
- if !sym. can_be_raw ( ) {
221
- self . err_span ( span, & format ! ( "`{}` cannot be a raw identifier" , sym) ) ;
222
- }
223
- self . sess . raw_identifier_spans . borrow_mut ( ) . push ( span) ;
208
+ token:: Ident ( sym, false )
209
+ }
210
+ rustc_lexer:: TokenKind :: RawIdent => {
211
+ let sym = nfc_normalize ( self . str_from ( start + BytePos ( 2 ) ) ) ;
212
+ let span = self . mk_sp ( start, self . pos ) ;
213
+ self . sess . symbol_gallery . insert ( sym, span) ;
214
+ if !sym. can_be_raw ( ) {
215
+ self . err_span ( span, & format ! ( "`{}` cannot be a raw identifier" , sym) ) ;
224
216
}
225
- token:: Ident ( sym, is_raw_ident)
217
+ self . sess . raw_identifier_spans . borrow_mut ( ) . push ( span) ;
218
+ token:: Ident ( sym, true )
219
+ }
220
+ rustc_lexer:: TokenKind :: UnknownPrefix => {
221
+ self . report_unknown_prefix ( start) ;
222
+ let sym = nfc_normalize ( self . str_from ( start) ) ;
223
+ let span = self . mk_sp ( start, self . pos ) ;
224
+ self . sess . symbol_gallery . insert ( sym, span) ;
225
+ token:: Ident ( sym, false )
226
226
}
227
227
rustc_lexer:: TokenKind :: InvalidIdent
228
228
// Do not recover an identifier with emoji if the codepoint is a confusable
0 commit comments