11warning: incorrect NaN comparison, NaN cannot be directly compared to itself
2- --> $DIR/invalid-nan-comparison-suggestion.rs:6 :13
2+ --> $DIR/invalid-nan-comparison-suggestion.rs:8 :13
33 |
4- LL | let _ = x == f32 ::NAN;
4+ LL | let _ = x == f16 ::NAN;
55 | ^^^^^^^^^^^^^
66 |
77 = note: `#[warn(invalid_nan_comparisons)]` on by default
88help: use `f32::is_nan()` or `f64::is_nan()` instead
99 |
10+ LL - let _ = x == f16::NAN;
11+ LL + let _ = x.is_nan();
12+ |
13+
14+ warning: incorrect NaN comparison, NaN cannot be directly compared to itself
15+ --> $DIR/invalid-nan-comparison-suggestion.rs:10:13
16+ |
17+ LL | let _ = x != f16::NAN;
18+ | ^^^^^^^^^^^^^
19+ |
20+ help: use `f32::is_nan()` or `f64::is_nan()` instead
21+ |
22+ LL - let _ = x != f16::NAN;
23+ LL + let _ = !x.is_nan();
24+ |
25+
26+ warning: incorrect NaN comparison, NaN cannot be directly compared to itself
27+ --> $DIR/invalid-nan-comparison-suggestion.rs:14:13
28+ |
29+ LL | let _ = x == f32::NAN;
30+ | ^^^^^^^^^^^^^
31+ |
32+ help: use `f32::is_nan()` or `f64::is_nan()` instead
33+ |
1034LL - let _ = x == f32::NAN;
1135LL + let _ = x.is_nan();
1236 |
1337
1438warning: incorrect NaN comparison, NaN cannot be directly compared to itself
15- --> $DIR/invalid-nan-comparison-suggestion.rs:8 :13
39+ --> $DIR/invalid-nan-comparison-suggestion.rs:16 :13
1640 |
1741LL | let _ = x != f32::NAN;
1842 | ^^^^^^^^^^^^^
@@ -24,7 +48,7 @@ LL + let _ = !x.is_nan();
2448 |
2549
2650warning: incorrect NaN comparison, NaN cannot be directly compared to itself
27- --> $DIR/invalid-nan-comparison-suggestion.rs:12 :13
51+ --> $DIR/invalid-nan-comparison-suggestion.rs:20 :13
2852 |
2953LL | let _ = x == f64::NAN;
3054 | ^^^^^^^^^^^^^
@@ -36,7 +60,7 @@ LL + let _ = x.is_nan();
3660 |
3761
3862warning: incorrect NaN comparison, NaN cannot be directly compared to itself
39- --> $DIR/invalid-nan-comparison-suggestion.rs:14 :13
63+ --> $DIR/invalid-nan-comparison-suggestion.rs:22 :13
4064 |
4165LL | let _ = x != f64::NAN;
4266 | ^^^^^^^^^^^^^
@@ -48,7 +72,31 @@ LL + let _ = !x.is_nan();
4872 |
4973
5074warning: incorrect NaN comparison, NaN cannot be directly compared to itself
51- --> $DIR/invalid-nan-comparison-suggestion.rs:18:8
75+ --> $DIR/invalid-nan-comparison-suggestion.rs:26:13
76+ |
77+ LL | let _ = x == f128::NAN;
78+ | ^^^^^^^^^^^^^^
79+ |
80+ help: use `f32::is_nan()` or `f64::is_nan()` instead
81+ |
82+ LL - let _ = x == f128::NAN;
83+ LL + let _ = x.is_nan();
84+ |
85+
86+ warning: incorrect NaN comparison, NaN cannot be directly compared to itself
87+ --> $DIR/invalid-nan-comparison-suggestion.rs:28:13
88+ |
89+ LL | let _ = x != f128::NAN;
90+ | ^^^^^^^^^^^^^^
91+ |
92+ help: use `f32::is_nan()` or `f64::is_nan()` instead
93+ |
94+ LL - let _ = x != f128::NAN;
95+ LL + let _ = !x.is_nan();
96+ |
97+
98+ warning: incorrect NaN comparison, NaN cannot be directly compared to itself
99+ --> $DIR/invalid-nan-comparison-suggestion.rs:32:8
52100 |
53101LL | if b != &f32::NAN {}
54102 | ^^^^^^^^^^^^^^
@@ -60,7 +108,7 @@ LL + if !b.is_nan() {}
60108 |
61109
62110warning: incorrect NaN comparison, NaN cannot be directly compared to itself
63- --> $DIR/invalid-nan-comparison-suggestion.rs:22 :8
111+ --> $DIR/invalid-nan-comparison-suggestion.rs:36 :8
64112 |
65113LL | if b != { &f32::NAN } {}
66114 | ^^^^^^^^^^^^^^^^^^
@@ -72,7 +120,7 @@ LL + if !b.is_nan() {}
72120 |
73121
74122warning: incorrect NaN comparison, NaN cannot be directly compared to itself
75- --> $DIR/invalid-nan-comparison-suggestion.rs:26 :9
123+ --> $DIR/invalid-nan-comparison-suggestion.rs:40 :9
76124 |
77125LL | / b != {
78126LL | |
@@ -87,7 +135,7 @@ LL + !b.is_nan();
87135 |
88136
89137warning: incorrect NaN comparison, NaN cannot be directly compared to itself
90- --> $DIR/invalid-nan-comparison-suggestion.rs:35 :13
138+ --> $DIR/invalid-nan-comparison-suggestion.rs:49 :13
91139 |
92140LL | let _ = nan!() == number!();
93141 | ^^^^^^^^^^^^^^^^^^^
@@ -99,7 +147,7 @@ LL + let _ = number!().is_nan();
99147 |
100148
101149warning: incorrect NaN comparison, NaN cannot be directly compared to itself
102- --> $DIR/invalid-nan-comparison-suggestion.rs:37 :13
150+ --> $DIR/invalid-nan-comparison-suggestion.rs:51 :13
103151 |
104152LL | let _ = number!() != nan!();
105153 | ^^^^^^^^^^^^^^^^^^^
@@ -110,5 +158,5 @@ LL - let _ = number!() != nan!();
110158LL + let _ = !number!().is_nan();
111159 |
112160
113- warning: 9 warnings emitted
161+ warning: 13 warnings emitted
114162
0 commit comments