rust/tests/ui/numbers-arithmetic/unary-minus-suffix-inference.rs
2023-01-11 09:32:08 +00:00

24 lines
371 B
Rust

// run-pass
pub fn main() {
let a = 1;
let a_neg: i8 = -a;
println!("{}", a_neg);
let b = 1;
let b_neg: i16 = -b;
println!("{}", b_neg);
let c = 1;
let c_neg: i32 = -c;
println!("{}", c_neg);
let d = 1;
let d_neg: i64 = -d;
println!("{}", d_neg);
let e = 1;
let e_neg: isize = -e;
println!("{}", e_neg);
}