diff options
| author | oliver-giersch <oliver.giersch@googlemail.com> | 2018-10-15 14:37:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 14:37:54 +0200 |
| commit | 5891a64165ea4819ca331f5a35f5318a91e1be3f (patch) | |
| tree | e2da4d1f0bf89c9bce5c29783744f12039b3dd33 /src/libsyntax/parse/parser.rs | |
| parent | fa76d42b3e547bd3a0e049cc2c1e00f6b9560d6c (diff) | |
| parent | 42f401dd02fd418e038d9b2829d60d69407e9aab (diff) | |
| download | rust-5891a64165ea4819ca331f5a35f5318a91e1be3f.tar.gz rust-5891a64165ea4819ca331f5a35f5318a91e1be3f.zip | |
Merge pull request #4 from rust-lang/master
sync with upstream
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b5896f37c00..c7089a295fc 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6346,7 +6346,13 @@ impl<'a> Parser<'a> { } fn parse_item_const(&mut self, m: Option<Mutability>) -> PResult<'a, ItemInfo> { - let id = self.parse_ident()?; + let id = match self.token { + token::Ident(ident, false) if ident.name == keywords::Underscore.name() => { + self.bump(); // `_` + ident.gensym() + }, + _ => self.parse_ident()?, + }; self.expect(&token::Colon)?; let ty = self.parse_ty()?; self.expect(&token::Eq)?; |
