]> git.lizzy.rs Git - rust.git/blob - tests/ui/cmp_nan.rs
Merge pull request #1520 from Manishearth/rustup
[rust.git] / tests / ui / cmp_nan.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 #[deny(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 }