File tree 1 file changed +7
-5
lines changed
compiler/rustc_parse/src/parser
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -994,22 +994,24 @@ impl<'a> Parser<'a> {
994
994
995
995
/// Advance the parser by one token.
996
996
pub fn bump ( & mut self ) {
997
- let ( mut next, spacing) = self . token_cursor . inlined_next ( self . desugar_doc_comments ) ;
997
+ // Note: destructuring here would give nicer code, but it was found in #96210 to be slower
998
+ // than `.0`/`.1` access.
999
+ let mut next = self . token_cursor . inlined_next ( self . desugar_doc_comments ) ;
998
1000
self . token_cursor . num_next_calls += 1 ;
999
1001
// We've retrieved an token from the underlying
1000
1002
// cursor, so we no longer need to worry about
1001
1003
// an unglued token. See `break_and_eat` for more details
1002
1004
self . token_cursor . break_last_token = false ;
1003
- if next. span . is_dummy ( ) {
1005
+ if next. 0 . span . is_dummy ( ) {
1004
1006
// Tweak the location for better diagnostics, but keep syntactic context intact.
1005
1007
let fallback_span = self . token . span ;
1006
- next. span = fallback_span. with_ctxt ( next. span . ctxt ( ) ) ;
1008
+ next. 0 . span = fallback_span. with_ctxt ( next. 0 . span . ctxt ( ) ) ;
1007
1009
}
1008
1010
debug_assert ! ( !matches!(
1009
- next. kind,
1011
+ next. 0 . kind,
1010
1012
token:: OpenDelim ( token:: NoDelim ) | token:: CloseDelim ( token:: NoDelim )
1011
1013
) ) ;
1012
- self . inlined_bump_with ( ( next, spacing ) )
1014
+ self . inlined_bump_with ( next)
1013
1015
}
1014
1016
1015
1017
/// Look-ahead `dist` tokens of `self.token` and get access to that token there.
You can’t perform that action at this time.
0 commit comments