summaryrefslogtreecommitdiffstats
path: root/tests/ui/numbers-arithmetic/unary-minus-suffix-inference.rs
blob: a4d0a849484ec9bb81100ebb16634bf4a942b257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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);
}