Skip to content

Commit 4639128

Browse files
committed
test: avoid triggering an unsigned negation error from MIR building.
1 parent d434688 commit 4639128

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/compile-fail/feature-gate-negate-unsigned.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ impl std::ops::Neg for S {
1616
fn neg(self) -> u32 { 0 }
1717
}
1818

19-
const _MAX: usize = -1;
19+
// FIXME(eddyb) move this back to a `-1` literal when
20+
// MIR building stops eagerly erroring in that case.
21+
const _MAX: usize = -(2 - 1);
2022
//~^ WARN unary negation of unsigned integer
2123
//~| ERROR unary negation of unsigned integer
2224
//~| HELP use a cast or the `!` operator

0 commit comments

Comments
 (0)