diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-04-26 01:13:25 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-05-07 07:19:10 +0300 |
| commit | 4639128d4099352345f3226ed8e664acdad7e8c9 (patch) | |
| tree | 4821bc168b4528cec9825c53b0f245bcab109394 | |
| parent | d434688516f809cff835e76eb6cba07d23e48a2d (diff) | |
| download | rust-4639128d4099352345f3226ed8e664acdad7e8c9.tar.gz rust-4639128d4099352345f3226ed8e664acdad7e8c9.zip | |
test: avoid triggering an unsigned negation error from MIR building.
| -rw-r--r-- | src/test/compile-fail/feature-gate-negate-unsigned.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/compile-fail/feature-gate-negate-unsigned.rs b/src/test/compile-fail/feature-gate-negate-unsigned.rs index 93e09c6d8d2..98cc2fc0c3e 100644 --- a/src/test/compile-fail/feature-gate-negate-unsigned.rs +++ b/src/test/compile-fail/feature-gate-negate-unsigned.rs @@ -16,7 +16,9 @@ impl std::ops::Neg for S { fn neg(self) -> u32 { 0 } } -const _MAX: usize = -1; +// FIXME(eddyb) move this back to a `-1` literal when +// MIR building stops eagerly erroring in that case. +const _MAX: usize = -(2 - 1); //~^ WARN unary negation of unsigned integer //~| ERROR unary negation of unsigned integer //~| HELP use a cast or the `!` operator |
