]> git.lizzy.rs Git - rust.git/commitdiff
test: avoid triggering an unsigned negation error from MIR building.
authorEduard Burtescu <edy.burt@gmail.com>
Mon, 25 Apr 2016 22:13:25 +0000 (01:13 +0300)
committerEduard Burtescu <edy.burt@gmail.com>
Sat, 7 May 2016 04:19:10 +0000 (07:19 +0300)
src/test/compile-fail/feature-gate-negate-unsigned.rs

index 93e09c6d8d2d25161dc4b1ec1b5f624fb662ea4b..98cc2fc0c3e0cf9ec22d2de7dde2b3c5d5e04163 100644 (file)
@@ -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