2015-05-04 14:11:15 +02:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#[deny(cmp_nan)]
|
2015-05-06 10:01:49 +02:00
|
|
|
#[allow(float_cmp)]
|
2015-05-04 14:11:15 +02:00
|
|
|
fn main() {
|
2015-08-11 20:22:20 +02:00
|
|
|
let x = 5f32;
|
2015-08-13 08:12:07 +02:00
|
|
|
x == std::f32::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
x != std::f32::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
x < std::f32::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
x > std::f32::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
x <= std::f32::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
x >= std::f32::NAN; //~ERROR doomed comparison with NAN
|
2015-05-04 14:11:15 +02:00
|
|
|
|
2015-08-11 20:22:20 +02:00
|
|
|
let y = 0f64;
|
2015-08-13 08:12:07 +02:00
|
|
|
y == std::f64::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
y != std::f64::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
y < std::f64::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
y > std::f64::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
y <= std::f64::NAN; //~ERROR doomed comparison with NAN
|
|
|
|
y >= std::f64::NAN; //~ERROR doomed comparison with NAN
|
2015-05-04 14:11:15 +02:00
|
|
|
}
|