about summary refs log tree commit diff
path: root/tests/ui/lint/lint-type-overflow2.rs
blob: ac7420326c893c685e443219f663a9f4f6ae00af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ compile-flags: -O

#![deny(overflowing_literals)]

fn main() {
    let x2: i8 = --128; //~ ERROR literal out of range for `i8`
    //~| WARN use of a double negation

    let x = -3.40282357e+38_f32; //~ ERROR literal out of range for `f32`
    let x =  3.40282357e+38_f32; //~ ERROR literal out of range for `f32`
    let x = -1.7976931348623159e+308_f64; //~ ERROR literal out of range for `f64`
    let x =  1.7976931348623159e+308_f64; //~ ERROR literal out of range for `f64`
}