summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/invalid-nan-comparison-suggestion.stderr
blob: c310341de07b73bc14c331eab80a19faf2957c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:6:13
   |
LL |     let _ = x == f32::NAN;
   |             ^^^^^^^^^^^^^
   |
   = note: `#[warn(invalid_nan_comparisons)]` on by default
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     let _ = x == f32::NAN;
LL +     let _ = x.is_nan();
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:8:13
   |
LL |     let _ = x != f32::NAN;
   |             ^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     let _ = x != f32::NAN;
LL +     let _ = !x.is_nan();
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:12:13
   |
LL |     let _ = x == f64::NAN;
   |             ^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     let _ = x == f64::NAN;
LL +     let _ = x.is_nan();
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:14:13
   |
LL |     let _ = x != f64::NAN;
   |             ^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     let _ = x != f64::NAN;
LL +     let _ = !x.is_nan();
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:18:8
   |
LL |     if b != &f32::NAN {}
   |        ^^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     if b != &f32::NAN {}
LL +     if !b.is_nan() {}
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:22:8
   |
LL |     if b != { &f32::NAN } {}
   |        ^^^^^^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     if b != { &f32::NAN } {}
LL +     if !b.is_nan() {}
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:26:9
   |
LL | /         b != {
LL | |
LL | |             &f32::NAN
LL | |         };
   | |_________^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -         b != {
LL +         !b.is_nan();
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:35:13
   |
LL |     let _ = nan!() == number!();
   |             ^^^^^^^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     let _ = nan!() == number!();
LL +     let _ = number!().is_nan();
   |

warning: incorrect NaN comparison, NaN cannot be directly compared to itself
  --> $DIR/invalid-nan-comparison-suggestion.rs:37:13
   |
LL |     let _ = number!() != nan!();
   |             ^^^^^^^^^^^^^^^^^^^
   |
help: use `f32::is_nan()` or `f64::is_nan()` instead
   |
LL -     let _ = number!() != nan!();
LL +     let _ = !number!().is_nan();
   |

warning: 9 warnings emitted