Convert negate_unsigned feature gate to a warning

This commit is contained in:
Simonas Kazlauskas 2015-07-20 12:17:55 +03:00
parent 22502154e6
commit 0ca8e4994e
2 changed files with 13 additions and 11 deletions

View file

@ -18,21 +18,21 @@ impl std::ops::Neg for S {
}
const _MAX: usize = -1;
//~^ ERROR unary negation of unsigned integers may be removed in the future
//~^ WARN unary negation of unsigned integers will be feature gated in the future
fn main() {
let a = -1;
//~^ ERROR unary negation of unsigned integers may be removed in the future
//~^ WARN unary negation of unsigned integers will be feature gated in the future
let _b : u8 = a; // for infering variable a to u8.
-a;
//~^ ERROR unary negation of unsigned integers may be removed in the future
//~^ WARN unary negation of unsigned integers will be feature gated in the future
let _d = -1u8;
//~^ ERROR unary negation of unsigned integers may be removed in the future
//~^ WARN unary negation of unsigned integers will be feature gated in the future
for _ in -10..10u8 {}
//~^ ERROR unary negation of unsigned integers may be removed in the future
//~^ WARN unary negation of unsigned integers will be feature gated in the future
-S; // should not trigger the gate; issue 26840
}