]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #48842 - petrochenkov:under, r=nikomatsakis
authorbors <bors@rust-lang.org>
Sat, 17 Mar 2018 23:22:57 +0000 (23:22 +0000)
committerbors <bors@rust-lang.org>
Sat, 17 Mar 2018 23:22:57 +0000 (23:22 +0000)
syntax: Make `_` a reserved identifier

Why:
- Lexically `_` is an identifier.
- Internally it makes implementation of `use Trait as _;` (https://github.com/rust-lang/rust/issues/48216) and some other things cleaner.
- We prevent the externally observable effect of `_` being accepted by macros expecting `ident` by treating `_` specially in the `ident` matcher:
```rust
macro_rules! m {
    ($i: ident) => { let $i = 10; }
}

m!(_); // Still an error
```


Trivial merge