about summary refs log tree commit diff
path: root/tests/ui/lint/lint-type-limits3.rs
blob: 1a08d75aba689f212f7b254ca44e47ee14427120 (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;
    }
}