mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
19 lines
438 B
Rust
19 lines
438 B
Rust
#[warn(clippy::cmp_nan)]
|
|
#[allow(clippy::float_cmp, clippy::no_effect, clippy::unnecessary_operation)]
|
|
fn main() {
|
|
let x = 5f32;
|
|
x == std::f32::NAN;
|
|
x != std::f32::NAN;
|
|
x < std::f32::NAN;
|
|
x > std::f32::NAN;
|
|
x <= std::f32::NAN;
|
|
x >= std::f32::NAN;
|
|
|
|
let y = 0f64;
|
|
y == std::f64::NAN;
|
|
y != std::f64::NAN;
|
|
y < std::f64::NAN;
|
|
y > std::f64::NAN;
|
|
y <= std::f64::NAN;
|
|
y >= std::f64::NAN;
|
|
}
|