about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse/parser')
-rw-r--r--src/libsyntax/parse/parser/item.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser/item.rs b/src/libsyntax/parse/parser/item.rs
index 5e264a0ca77..c5608a160cf 100644
--- a/src/libsyntax/parse/parser/item.rs
+++ b/src/libsyntax/parse/parser/item.rs
@@ -1182,6 +1182,17 @@ impl<'a> Parser<'a> {
         }
     }
 
+    fn parse_ident_or_underscore(&mut self) -> PResult<'a, ast::Ident> {
+        match self.token.kind {
+            token::Ident(name, false) if name == kw::Underscore => {
+                let span = self.token.span;
+                self.bump();
+                Ok(Ident::new(name, span))
+            }
+            _ => self.parse_ident(),
+        }
+    }
+
     /// Parses `extern crate` links.
     ///
     /// # Examples