Skip to content

Commit ceae6c6

Browse files
committed
Fix NAN comparison lint to use assoc NAN
1 parent 7907abe commit ceae6c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clippy_lints/src/misc.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ declare_clippy_lint! {
5757
///
5858
/// **Example:**
5959
/// ```rust
60-
/// # use core::f32::NAN;
6160
/// # let x = 1.0;
6261
///
63-
/// if x == NAN { }
62+
/// if x == f32::NAN { }
6463
/// ```
6564
pub CMP_NAN,
6665
correctness,
@@ -457,7 +456,7 @@ fn check_nan(cx: &LateContext<'_, '_>, expr: &Expr<'_>, cmp_expr: &Expr<'_>) {
457456
cx,
458457
CMP_NAN,
459458
cmp_expr.span,
460-
"doomed comparison with `NAN`, use `std::{f32,f64}::is_nan()` instead",
459+
"doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead",
461460
);
462461
}
463462
}

0 commit comments

Comments
 (0)