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

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

fn qux() {
    let mut i = 1i8;
    while 200 != i { //~ ERROR comparison is useless due to type limits
                     //~| WARN literal out of range for `i8`
        i += 1;
    }
}