summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/lint-type-limits2.rs
blob: 3f90119cd89543d8d39ba015a3802be2c8c485cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![allow(dead_code)]
#![warn(overflowing_literals)]

// compile-flags: -D unused-comparisons
fn main() { }


fn bar() -> i8 {
    return 123;
}

fn baz() -> bool {
    128 > bar() //~ ERROR comparison is useless due to type limits
                //~| WARN literal out of range for `i8`
}