Skip to content

Commit 79c4727

Browse files
committed
Don't try to recover keyword as non-keyword identifier
There's no sensible recovery scheme here, giving up the recovery is the right thing to do.
1 parent 31531b3 commit 79c4727

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • compiler/rustc_parse/src/parser

compiler/rustc_parse/src/parser/item.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ impl<'a> Parser<'a> {
408408
let insert_span = ident_span.shrink_to_lo();
409409

410410
let ident = if self.token.is_ident()
411+
&& self.token.is_non_reserved_ident()
411412
&& (!is_const || self.look_ahead(1, |t| *t == token::OpenParen))
412413
&& self.look_ahead(1, |t| {
413414
matches!(t.kind, token::Lt | token::OpenBrace | token::OpenParen)

0 commit comments

Comments
 (0)