diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-05-04 22:55:35 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-05-04 23:31:02 +0530 |
| commit | 5f9e30431021f1c8eae7f4cfa6db9b1d39a8e216 (patch) | |
| tree | 09845ea2cfc80c9d63b499bc2841ce45d0657b0e /src/test/compile-fail/const-pattern-irrefutable.rs | |
| parent | 3157691f963a86776cb7e6a7842f566032890aba (diff) | |
| download | rust-5f9e30431021f1c8eae7f4cfa6db9b1d39a8e216.tar.gz rust-5f9e30431021f1c8eae7f4cfa6db9b1d39a8e216.zip | |
Improve diagnostics for constants being used in irrefutable patterns
It's pretty confusing and this error triggers in resolve only when "shadowing" a const, so let's make that clearer.
Diffstat (limited to 'src/test/compile-fail/const-pattern-irrefutable.rs')
| -rw-r--r-- | src/test/compile-fail/const-pattern-irrefutable.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/compile-fail/const-pattern-irrefutable.rs b/src/test/compile-fail/const-pattern-irrefutable.rs index 825c39011fc..0be1e974e7d 100644 --- a/src/test/compile-fail/const-pattern-irrefutable.rs +++ b/src/test/compile-fail/const-pattern-irrefutable.rs @@ -19,10 +19,10 @@ use foo::d; //~ NOTE constant imported here const a: u8 = 2; //~ NOTE constant defined here fn main() { - let a = 4; //~ ERROR only irrefutable + let a = 4; //~ ERROR variable bindings cannot //~^ NOTE there already is a constant in scope - let c = 4; //~ ERROR only irrefutable + let c = 4; //~ ERROR variable bindings cannot //~^ NOTE there already is a constant in scope - let d = 4; //~ ERROR only irrefutable + let d = 4; //~ ERROR variable bindings cannot //~^ NOTE there already is a constant in scope } |
