about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index f31e634f55c..2c98feeece7 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -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,