2015-05-04 12:11:15 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#[deny(cmp_nan)]
|
2015-05-06 08:01:49 +00:00
|
|
|
#[allow(float_cmp)]
|
2015-05-04 12:11:15 +00:00
|
|
|
fn main() {
|
2015-08-11 18:22:20 +00:00
|
|
|
let x = 5f32;
|
2015-08-13 06:12:07 +00: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 12:11:15 +00:00
|
|
|
|
2015-08-11 18:22:20 +00:00
|
|
|
let y = 0f64;
|
2015-08-13 06:12:07 +00: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 12:11:15 +00:00
|
|
|
}
|