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.
(cherry picked from commit 79c47278f1)
This commit is contained in:
parent
f691f9a0ec
commit
feb759bb79
1 changed files with 1 additions and 0 deletions
|
|
@ -393,6 +393,7 @@ impl<'a> Parser<'a> {
|
|||
let insert_span = ident_span.shrink_to_lo();
|
||||
|
||||
let ident = if self.token.is_ident()
|
||||
&& self.token.is_non_reserved_ident()
|
||||
&& (!is_const || self.look_ahead(1, |t| *t == token::OpenParen))
|
||||
&& self.look_ahead(1, |t| {
|
||||
matches!(t.kind, token::Lt | token::OpenBrace | token::OpenParen)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue