rust/src/librustc_const_eval
bors a35a3abcda Auto merge of #45050 - petrochenkov:ambind, r=nikomatsakis
resolve: Use same rules for disambiguating fresh bindings in `match` and `let`

Resolve `Unit` as a unit struct pattern in
```rust
struct Unit;

let Unit = x;
```
consistently with
```rust
match x {
    Unit => {}
}
```
It was previously an error.
(The change also applies to unit variants and constants.)

Fixes https://users.rust-lang.org/t/e0530-cannot-shadow-unit-structs-what-in-the-earthly-what/13054
(This particular change doesn't depend on a fix for the issue mentioned in https://users.rust-lang.org/t/e0530-cannot-shadow-unit-structs-what-in-the-earthly-what/13054/4)

cc @rust-lang/lang
r? @nikomatsakis
2017-11-10 19:10:12 +00:00
..
_match.rs Implemented RFC 2008 for enums (not including variants) and structs. 2017-11-03 19:36:18 +00:00
Cargo.toml rustc_const_eval: move ConstEvalErr to the rustc crate. 2017-04-16 01:31:06 +03:00
check_match.rs Give better help for identifier patterns failing exhaustiveness check 2017-11-04 03:09:47 +03:00
diagnostics.rs rustc: remove obsolete const_val::ErrKind::{Negate,Not}On. 2017-09-11 08:41:15 +03:00
eval.rs Resolve types properly in const eval 2017-10-25 10:17:20 +02:00
lib.rs Bump to 1.23 and update bootstrap 2017-10-26 13:59:18 -07:00
pattern.rs implement pattern-binding-modes RFC 2017-10-06 16:30:23 -04:00