check is_ident before parse_ident
This commit is contained in:
@@ -387,8 +387,8 @@ impl<'a> Parser<'a> {
|
||||
let span = if is_pub { self.prev_token.span.to(ident_span) } else { ident_span };
|
||||
let insert_span = ident_span.shrink_to_lo();
|
||||
|
||||
let ident = if (!is_const
|
||||
|| self.look_ahead(1, |t| *t == token::OpenDelim(Delimiter::Parenthesis)))
|
||||
let ident = if self.token.is_ident()
|
||||
&& (!is_const || self.look_ahead(1, |t| *t == token::OpenDelim(Delimiter::Parenthesis)))
|
||||
&& self.look_ahead(1, |t| {
|
||||
[
|
||||
token::Lt,
|
||||
|
||||
Reference in New Issue
Block a user