]> git.lizzy.rs Git - rust.git/blob - tests/ui/cmp_nan.rs
Merge pull request #3085 from mikerite/revert-98dbce
[rust.git] / tests / ui / cmp_nan.rs
1 #![feature(tool_lints)]
2
3
4 #[warn(clippy::cmp_nan)]
5 #[allow(clippy::float_cmp, clippy::no_effect, clippy::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 }