From 4639128d4099352345f3226ed8e664acdad7e8c9 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 26 Apr 2016 01:13:25 +0300 Subject: [PATCH] test: avoid triggering an unsigned negation error from MIR building. --- src/test/compile-fail/feature-gate-negate-unsigned.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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