mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
7aee04878f
(Did not touch strings.rs, which is fixed by @llogiq's PR)
22 lines
848 B
Rust
Executable file
22 lines
848 B
Rust
Executable file
#![feature(plugin)]
|
|
#![plugin(clippy)]
|
|
|
|
#[deny(cmp_nan)]
|
|
#[allow(float_cmp)]
|
|
fn main() {
|
|
let x = 5f32;
|
|
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
|
|
|
|
let y = 0f64;
|
|
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
|
|
}
|