]> git.lizzy.rs Git - rust.git/blob - tests/ui/cmp_nan.rs
Reduce the hackiness of cargo-clippy
[rust.git] / tests / ui / cmp_nan.rs
1
2
3
4 #[warn(cmp_nan)]
5 #[allow(float_cmp, no_effect, unnecessary_operation)]
6 fn main() {
7     let x = 5f32;
8     x == std::f32::NAN;
9     x != std::f32::NAN;
10     x < std::f32::NAN;
11     x > std::f32::NAN;
12     x <= std::f32::NAN;
13     x >= std::f32::NAN;
14
15     let y = 0f64;
16     y == std::f64::NAN;
17     y != std::f64::NAN;
18     y < std::f64::NAN;
19     y > std::f64::NAN;
20     y <= std::f64::NAN;
21     y >= std::f64::NAN;
22 }