diff options
| author | kennytm <kennytm@gmail.com> | 2018-03-16 01:49:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-16 01:49:42 +0800 |
| commit | e1d19df9a5ba7befa89d6b0abf7448b6431533cb (patch) | |
| tree | 331250d9668ff94aa8cb2b3ab7eb9e20c2686a89 /src/libsyntax/parse | |
| parent | 68a602efa94c24a61d342eb325c59d785a3bb632 (diff) | |
| parent | 12ac032c72aed9cc7a10d057fbdd5b5f50f2b7c8 (diff) | |
| download | rust-e1d19df9a5ba7befa89d6b0abf7448b6431533cb.tar.gz rust-e1d19df9a5ba7befa89d6b0abf7448b6431533cb.zip | |
Rollup merge of #48922 - petrochenkov:asunder, r=nikomatsakis
Implement import renaming with `_` (RFC 2166) cc https://github.com/rust-lang/rust/issues/48216
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index bd0ca0e6704..2506a7f72d2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -7040,7 +7040,11 @@ impl<'a> Parser<'a> { fn parse_rename(&mut self) -> PResult<'a, Option<Ident>> { if self.eat_keyword(keywords::As) { - self.parse_ident().map(Some) + if self.eat(&token::Underscore) { + Ok(Some(Ident::with_empty_ctxt(Symbol::gensym("_")))) + } else { + self.parse_ident().map(Some) + } } else { Ok(None) } |
