Auto merge of #28468 - nagisa:revert-negate-unsigned-warning, r=alexcrichton

This reverts commit 0ca8e4994e.

Fixes #27141
This commit is contained in:
bors 2015-09-19 01:59:56 +00:00
commit 2915f89167
4 changed files with 15 additions and 14 deletions

View file

@ -192,7 +192,7 @@ fn write_line(init_i: f64, vec_init_r: &[f64], res: &mut Vec<u8>) {
i += 2;
}
res.push(cur_byte^-1);
res.push(cur_byte^!0);
}
}

View file

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

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(negate_unsigned)]
pub fn main() {
let a = 1;
let a_neg: i8 = -a;