about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/declared_lints.rs1
-rw-r--r--clippy_lints/src/operators/cmp_nan.rs30
-rw-r--r--clippy_lints/src/operators/mod.rs28
-rw-r--r--clippy_lints/src/renamed_lints.rs1
-rw-r--r--tests/ui/cmp_nan.rs34
-rw-r--r--tests/ui/cmp_nan.stderr148
-rw-r--r--tests/ui/crashes/mut_mut_macro.rs5
-rw-r--r--tests/ui/rename.fixed2
-rw-r--r--tests/ui/rename.rs2
-rw-r--r--tests/ui/rename.stderr110
-rw-r--r--tests/ui/unknown_clippy_lints.fixed2
-rw-r--r--tests/ui/unknown_clippy_lints.rs2
-rw-r--r--tests/ui/unknown_clippy_lints.stderr6
13 files changed, 70 insertions, 301 deletions
diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs
index 6270d261313..f1d1355123a 100644
--- a/clippy_lints/src/declared_lints.rs
+++ b/clippy_lints/src/declared_lints.rs
@@ -476,7 +476,6 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
     crate::operators::ARITHMETIC_SIDE_EFFECTS_INFO,
     crate::operators::ASSIGN_OP_PATTERN_INFO,
     crate::operators::BAD_BIT_MASK_INFO,
-    crate::operators::CMP_NAN_INFO,
     crate::operators::CMP_OWNED_INFO,
     crate::operators::DOUBLE_COMPARISONS_INFO,
     crate::operators::DURATION_SUBSEC_INFO,
diff --git a/clippy_lints/src/operators/cmp_nan.rs b/clippy_lints/src/operators/cmp_nan.rs
deleted file mode 100644
index e18064b7061..00000000000
--- a/clippy_lints/src/operators/cmp_nan.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-use clippy_utils::consts::{constant, Constant};
-use clippy_utils::diagnostics::span_lint;
-use clippy_utils::in_constant;
-use rustc_hir::{BinOpKind, Expr};
-use rustc_lint::LateContext;
-
-use super::CMP_NAN;
-
-pub(super) fn check(cx: &LateContext<'_>, e: &Expr<'_>, op: BinOpKind, lhs: &Expr<'_>, rhs: &Expr<'_>) {
-    if op.is_comparison() && !in_constant(cx, e.hir_id) && (is_nan(cx, lhs) || is_nan(cx, rhs)) {
-        span_lint(
-            cx,
-            CMP_NAN,
-            e.span,
-            "doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead",
-        );
-    }
-}
-
-fn is_nan(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
-    if let Some(value) = constant(cx, cx.typeck_results(), e) {
-        match value {
-            Constant::F32(num) => num.is_nan(),
-            Constant::F64(num) => num.is_nan(),
-            _ => false,
-        }
-    } else {
-        false
-    }
-}
diff --git a/clippy_lints/src/operators/mod.rs b/clippy_lints/src/operators/mod.rs
index d63a836e73d..2cf15adda01 100644
--- a/clippy_lints/src/operators/mod.rs
+++ b/clippy_lints/src/operators/mod.rs
@@ -1,7 +1,6 @@
 mod absurd_extreme_comparisons;
 mod assign_op_pattern;
 mod bit_mask;
-mod cmp_nan;
 mod cmp_owned;
 mod double_comparison;
 mod duration_subsec;
@@ -487,31 +486,6 @@ declare_clippy_lint! {
 
 declare_clippy_lint! {
     /// ### What it does
-    /// Checks for comparisons to NaN.
-    ///
-    /// ### Why is this bad?
-    /// NaN does not compare meaningfully to anything – not
-    /// even itself – so those comparisons are simply wrong.
-    ///
-    /// ### Example
-    /// ```rust
-    /// # let x = 1.0;
-    /// if x == f32::NAN { }
-    /// ```
-    ///
-    /// Use instead:
-    /// ```rust
-    /// # let x = 1.0f32;
-    /// if x.is_nan() { }
-    /// ```
-    #[clippy::version = "pre 1.29.0"]
-    pub CMP_NAN,
-    correctness,
-    "comparisons to `NAN`, which will always return false, probably not intended"
-}
-
-declare_clippy_lint! {
-    /// ### What it does
     /// Checks for conversions to owned values just for the sake
     /// of a comparison.
     ///
@@ -775,7 +749,6 @@ impl_lint_pass!(Operators => [
     FLOAT_EQUALITY_WITHOUT_ABS,
     IDENTITY_OP,
     INTEGER_DIVISION,
-    CMP_NAN,
     CMP_OWNED,
     FLOAT_CMP,
     FLOAT_CMP_CONST,
@@ -816,7 +789,6 @@ impl<'tcx> LateLintPass<'tcx> for Operators {
                 duration_subsec::check(cx, e, op.node, lhs, rhs);
                 float_equality_without_abs::check(cx, e, op.node, lhs, rhs);
                 integer_division::check(cx, e, op.node, lhs, rhs);
-                cmp_nan::check(cx, e, op.node, lhs, rhs);
                 cmp_owned::check(cx, op.node, lhs, rhs);
                 float_cmp::check(cx, e, op.node, lhs, rhs);
                 modulo_one::check(cx, e, op.node, rhs);
diff --git a/clippy_lints/src/renamed_lints.rs b/clippy_lints/src/renamed_lints.rs
index f76fa76f076..cbcd11debfd 100644
--- a/clippy_lints/src/renamed_lints.rs
+++ b/clippy_lints/src/renamed_lints.rs
@@ -33,6 +33,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
     ("clippy::zero_width_space", "clippy::invisible_characters"),
     ("clippy::cast_ref_to_mut", "cast_ref_to_mut"),
     ("clippy::clone_double_ref", "suspicious_double_ref_op"),
+    ("clippy::cmp_nan", "invalid_nan_comparisons"),
     ("clippy::drop_bounds", "drop_bounds"),
     ("clippy::drop_copy", "dropping_copy_types"),
     ("clippy::drop_ref", "dropping_references"),
diff --git a/tests/ui/cmp_nan.rs b/tests/ui/cmp_nan.rs
deleted file mode 100644
index 64ca52b010a..00000000000
--- a/tests/ui/cmp_nan.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-const NAN_F32: f32 = f32::NAN;
-const NAN_F64: f64 = f64::NAN;
-
-#[warn(clippy::cmp_nan)]
-#[allow(clippy::float_cmp, clippy::no_effect, clippy::unnecessary_operation)]
-fn main() {
-    let x = 5f32;
-    x == f32::NAN;
-    x != f32::NAN;
-    x < f32::NAN;
-    x > f32::NAN;
-    x <= f32::NAN;
-    x >= f32::NAN;
-    x == NAN_F32;
-    x != NAN_F32;
-    x < NAN_F32;
-    x > NAN_F32;
-    x <= NAN_F32;
-    x >= NAN_F32;
-
-    let y = 0f64;
-    y == f64::NAN;
-    y != f64::NAN;
-    y < f64::NAN;
-    y > f64::NAN;
-    y <= f64::NAN;
-    y >= f64::NAN;
-    y == NAN_F64;
-    y != NAN_F64;
-    y < NAN_F64;
-    y > NAN_F64;
-    y <= NAN_F64;
-    y >= NAN_F64;
-}
diff --git a/tests/ui/cmp_nan.stderr b/tests/ui/cmp_nan.stderr
deleted file mode 100644
index 867516661a5..00000000000
--- a/tests/ui/cmp_nan.stderr
+++ /dev/null
@@ -1,148 +0,0 @@
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:8:5
-   |
-LL |     x == f32::NAN;
-   |     ^^^^^^^^^^^^^
-   |
-   = note: `-D clippy::cmp-nan` implied by `-D warnings`
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:9:5
-   |
-LL |     x != f32::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:10:5
-   |
-LL |     x < f32::NAN;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:11:5
-   |
-LL |     x > f32::NAN;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:12:5
-   |
-LL |     x <= f32::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:13:5
-   |
-LL |     x >= f32::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:14:5
-   |
-LL |     x == NAN_F32;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:15:5
-   |
-LL |     x != NAN_F32;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:16:5
-   |
-LL |     x < NAN_F32;
-   |     ^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:17:5
-   |
-LL |     x > NAN_F32;
-   |     ^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:18:5
-   |
-LL |     x <= NAN_F32;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:19:5
-   |
-LL |     x >= NAN_F32;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:22:5
-   |
-LL |     y == f64::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:23:5
-   |
-LL |     y != f64::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:24:5
-   |
-LL |     y < f64::NAN;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:25:5
-   |
-LL |     y > f64::NAN;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:26:5
-   |
-LL |     y <= f64::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:27:5
-   |
-LL |     y >= f64::NAN;
-   |     ^^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:28:5
-   |
-LL |     y == NAN_F64;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:29:5
-   |
-LL |     y != NAN_F64;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:30:5
-   |
-LL |     y < NAN_F64;
-   |     ^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:31:5
-   |
-LL |     y > NAN_F64;
-   |     ^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:32:5
-   |
-LL |     y <= NAN_F64;
-   |     ^^^^^^^^^^^^
-
-error: doomed comparison with `NAN`, use `{f32,f64}::is_nan()` instead
-  --> $DIR/cmp_nan.rs:33:5
-   |
-LL |     y >= NAN_F64;
-   |     ^^^^^^^^^^^^
-
-error: aborting due to 24 previous errors
-
diff --git a/tests/ui/crashes/mut_mut_macro.rs b/tests/ui/crashes/mut_mut_macro.rs
index a238e7896fc..92821b6ecbb 100644
--- a/tests/ui/crashes/mut_mut_macro.rs
+++ b/tests/ui/crashes/mut_mut_macro.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
+#![deny(clippy::mut_mut, clippy::zero_ptr)]
 #![allow(dead_code)]
 
 // FIXME: compiletest + extern crates doesn't work together. To make this test work, it would need
@@ -8,13 +8,12 @@
 //     extern crate lazy_static;
 //     use std::collections::HashMap;
 
-/// ensure that we don't suggest `is_nan` and `is_null` inside constants
+/// ensure that we don't suggest `is_null` inside constants
 /// FIXME: once const fn is stable, suggest these functions again in constants
 
 const BAA: *const i32 = 0 as *const i32;
 static mut BAR: *const i32 = BAA;
 static mut FOO: *const i32 = 0 as *const i32;
-static mut BUH: bool = 42.0 < f32::NAN;
 
 #[allow(unused_variables, unused_mut)]
 fn main() {
diff --git a/tests/ui/rename.fixed b/tests/ui/rename.fixed
index 954145fc4e6..f1b25dc094e 100644
--- a/tests/ui/rename.fixed
+++ b/tests/ui/rename.fixed
@@ -41,6 +41,7 @@
 #![allow(invalid_atomic_ordering)]
 #![allow(invalid_value)]
 #![allow(invalid_from_utf8_unchecked)]
+#![allow(invalid_nan_comparisons)]
 #![allow(let_underscore_drop)]
 #![allow(enum_intrinsics_non_enums)]
 #![allow(non_fmt_panics)]
@@ -55,6 +56,7 @@
 #![warn(clippy::blocks_in_if_conditions)]
 #![warn(clippy::blocks_in_if_conditions)]
 #![warn(clippy::box_collection)]
+#![warn(invalid_nan_comparisons)]
 #![warn(clippy::redundant_static_lifetimes)]
 #![warn(clippy::cognitive_complexity)]
 #![warn(clippy::derived_hash_with_manual_eq)]
diff --git a/tests/ui/rename.rs b/tests/ui/rename.rs
index 067a3109afb..4af511c344c 100644
--- a/tests/ui/rename.rs
+++ b/tests/ui/rename.rs
@@ -41,6 +41,7 @@
 #![allow(invalid_atomic_ordering)]
 #![allow(invalid_value)]
 #![allow(invalid_from_utf8_unchecked)]
+#![allow(invalid_nan_comparisons)]
 #![allow(let_underscore_drop)]
 #![allow(enum_intrinsics_non_enums)]
 #![allow(non_fmt_panics)]
@@ -55,6 +56,7 @@
 #![warn(clippy::block_in_if_condition_expr)]
 #![warn(clippy::block_in_if_condition_stmt)]
 #![warn(clippy::box_vec)]
+#![warn(clippy::cmp_nan)]
 #![warn(clippy::const_static_lifetime)]
 #![warn(clippy::cyclomatic_complexity)]
 #![warn(clippy::derive_hash_xor_eq)]
diff --git a/tests/ui/rename.stderr b/tests/ui/rename.stderr
index 1819d108c57..156a8f96b50 100644
--- a/tests/ui/rename.stderr
+++ b/tests/ui/rename.stderr
@@ -1,5 +1,5 @@
 error: lint `clippy::almost_complete_letter_range` has been renamed to `clippy::almost_complete_range`
-  --> $DIR/rename.rs:53:9
+  --> $DIR/rename.rs:54:9
    |
 LL | #![warn(clippy::almost_complete_letter_range)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::almost_complete_range`
@@ -7,304 +7,310 @@ LL | #![warn(clippy::almost_complete_letter_range)]
    = note: `-D renamed-and-removed-lints` implied by `-D warnings`
 
 error: lint `clippy::blacklisted_name` has been renamed to `clippy::disallowed_names`
-  --> $DIR/rename.rs:54:9
+  --> $DIR/rename.rs:55:9
    |
 LL | #![warn(clippy::blacklisted_name)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_names`
 
 error: lint `clippy::block_in_if_condition_expr` has been renamed to `clippy::blocks_in_if_conditions`
-  --> $DIR/rename.rs:55:9
+  --> $DIR/rename.rs:56:9
    |
 LL | #![warn(clippy::block_in_if_condition_expr)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_if_conditions`
 
 error: lint `clippy::block_in_if_condition_stmt` has been renamed to `clippy::blocks_in_if_conditions`
-  --> $DIR/rename.rs:56:9
+  --> $DIR/rename.rs:57:9
    |
 LL | #![warn(clippy::block_in_if_condition_stmt)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_if_conditions`
 
 error: lint `clippy::box_vec` has been renamed to `clippy::box_collection`
-  --> $DIR/rename.rs:57:9
+  --> $DIR/rename.rs:58:9
    |
 LL | #![warn(clippy::box_vec)]
    |         ^^^^^^^^^^^^^^^ help: use the new name: `clippy::box_collection`
 
+error: lint `clippy::cmp_nan` has been renamed to `invalid_nan_comparisons`
+  --> $DIR/rename.rs:59:9
+   |
+LL | #![warn(clippy::cmp_nan)]
+   |         ^^^^^^^^^^^^^^^ help: use the new name: `invalid_nan_comparisons`
+
 error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
-  --> $DIR/rename.rs:58:9
+  --> $DIR/rename.rs:60:9
    |
 LL | #![warn(clippy::const_static_lifetime)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
 
 error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
-  --> $DIR/rename.rs:59:9
+  --> $DIR/rename.rs:61:9
    |
 LL | #![warn(clippy::cyclomatic_complexity)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
 
 error: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
-  --> $DIR/rename.rs:60:9
+  --> $DIR/rename.rs:62:9
    |
 LL | #![warn(clippy::derive_hash_xor_eq)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
 
 error: lint `clippy::disallowed_method` has been renamed to `clippy::disallowed_methods`
-  --> $DIR/rename.rs:61:9
+  --> $DIR/rename.rs:63:9
    |
 LL | #![warn(clippy::disallowed_method)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_methods`
 
 error: lint `clippy::disallowed_type` has been renamed to `clippy::disallowed_types`
-  --> $DIR/rename.rs:62:9
+  --> $DIR/rename.rs:64:9
    |
 LL | #![warn(clippy::disallowed_type)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_types`
 
 error: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_read_write_in_expression`
-  --> $DIR/rename.rs:63:9
+  --> $DIR/rename.rs:65:9
    |
 LL | #![warn(clippy::eval_order_dependence)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression`
 
 error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion`
-  --> $DIR/rename.rs:64:9
+  --> $DIR/rename.rs:66:9
    |
 LL | #![warn(clippy::identity_conversion)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion`
 
 error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok`
-  --> $DIR/rename.rs:65:9
+  --> $DIR/rename.rs:67:9
    |
 LL | #![warn(clippy::if_let_some_result)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok`
 
 error: lint `clippy::integer_arithmetic` has been renamed to `clippy::arithmetic_side_effects`
-  --> $DIR/rename.rs:66:9
+  --> $DIR/rename.rs:68:9
    |
 LL | #![warn(clippy::integer_arithmetic)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::arithmetic_side_effects`
 
 error: lint `clippy::logic_bug` has been renamed to `clippy::overly_complex_bool_expr`
-  --> $DIR/rename.rs:67:9
+  --> $DIR/rename.rs:69:9
    |
 LL | #![warn(clippy::logic_bug)]
    |         ^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::overly_complex_bool_expr`
 
 error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
-  --> $DIR/rename.rs:68:9
+  --> $DIR/rename.rs:70:9
    |
 LL | #![warn(clippy::new_without_default_derive)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
 
 error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map`
-  --> $DIR/rename.rs:69:9
+  --> $DIR/rename.rs:71:9
    |
 LL | #![warn(clippy::option_and_then_some)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map`
 
 error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used`
-  --> $DIR/rename.rs:70:9
+  --> $DIR/rename.rs:72:9
    |
 LL | #![warn(clippy::option_expect_used)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
 
 error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or`
-  --> $DIR/rename.rs:71:9
+  --> $DIR/rename.rs:73:9
    |
 LL | #![warn(clippy::option_map_unwrap_or)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
 
 error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
-  --> $DIR/rename.rs:72:9
+  --> $DIR/rename.rs:74:9
    |
 LL | #![warn(clippy::option_map_unwrap_or_else)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
 
 error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used`
-  --> $DIR/rename.rs:73:9
+  --> $DIR/rename.rs:75:9
    |
 LL | #![warn(clippy::option_unwrap_used)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
 
 error: lint `clippy::ref_in_deref` has been renamed to `clippy::needless_borrow`
-  --> $DIR/rename.rs:74:9
+  --> $DIR/rename.rs:76:9
    |
 LL | #![warn(clippy::ref_in_deref)]
    |         ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::needless_borrow`
 
 error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used`
-  --> $DIR/rename.rs:75:9
+  --> $DIR/rename.rs:77:9
    |
 LL | #![warn(clippy::result_expect_used)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
 
 error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
-  --> $DIR/rename.rs:76:9
+  --> $DIR/rename.rs:78:9
    |
 LL | #![warn(clippy::result_map_unwrap_or_else)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
 
 error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used`
-  --> $DIR/rename.rs:77:9
+  --> $DIR/rename.rs:79:9
    |
 LL | #![warn(clippy::result_unwrap_used)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
 
 error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str`
-  --> $DIR/rename.rs:78:9
+  --> $DIR/rename.rs:80:9
    |
 LL | #![warn(clippy::single_char_push_str)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::single_char_add_str`
 
 error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
-  --> $DIR/rename.rs:79:9
+  --> $DIR/rename.rs:81:9
    |
 LL | #![warn(clippy::stutter)]
    |         ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
 
 error: lint `clippy::to_string_in_display` has been renamed to `clippy::recursive_format_impl`
-  --> $DIR/rename.rs:80:9
+  --> $DIR/rename.rs:82:9
    |
 LL | #![warn(clippy::to_string_in_display)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::recursive_format_impl`
 
 error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_characters`
-  --> $DIR/rename.rs:81:9
+  --> $DIR/rename.rs:83:9
    |
 LL | #![warn(clippy::zero_width_space)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters`
 
 error: lint `clippy::cast_ref_to_mut` has been renamed to `cast_ref_to_mut`
-  --> $DIR/rename.rs:82:9
+  --> $DIR/rename.rs:84:9
    |
 LL | #![warn(clippy::cast_ref_to_mut)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `cast_ref_to_mut`
 
 error: lint `clippy::clone_double_ref` has been renamed to `suspicious_double_ref_op`
-  --> $DIR/rename.rs:83:9
+  --> $DIR/rename.rs:85:9
    |
 LL | #![warn(clippy::clone_double_ref)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `suspicious_double_ref_op`
 
 error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
-  --> $DIR/rename.rs:84:9
+  --> $DIR/rename.rs:86:9
    |
 LL | #![warn(clippy::drop_bounds)]
    |         ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
 
 error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types`
-  --> $DIR/rename.rs:85:9
+  --> $DIR/rename.rs:87:9
    |
 LL | #![warn(clippy::drop_copy)]
    |         ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types`
 
 error: lint `clippy::drop_ref` has been renamed to `dropping_references`
-  --> $DIR/rename.rs:86:9
+  --> $DIR/rename.rs:88:9
    |
 LL | #![warn(clippy::drop_ref)]
    |         ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references`
 
 error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles`
-  --> $DIR/rename.rs:87:9
+  --> $DIR/rename.rs:89:9
    |
 LL | #![warn(clippy::for_loop_over_option)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
 
 error: lint `clippy::for_loop_over_result` has been renamed to `for_loops_over_fallibles`
-  --> $DIR/rename.rs:88:9
+  --> $DIR/rename.rs:90:9
    |
 LL | #![warn(clippy::for_loop_over_result)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
 
 error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_over_fallibles`
-  --> $DIR/rename.rs:89:9
+  --> $DIR/rename.rs:91:9
    |
 LL | #![warn(clippy::for_loops_over_fallibles)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
 
 error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types`
-  --> $DIR/rename.rs:90:9
+  --> $DIR/rename.rs:92:9
    |
 LL | #![warn(clippy::forget_copy)]
    |         ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types`
 
 error: lint `clippy::forget_ref` has been renamed to `forgetting_references`
-  --> $DIR/rename.rs:91:9
+  --> $DIR/rename.rs:93:9
    |
 LL | #![warn(clippy::forget_ref)]
    |         ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references`
 
 error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
-  --> $DIR/rename.rs:92:9
+  --> $DIR/rename.rs:94:9
    |
 LL | #![warn(clippy::into_iter_on_array)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter`
 
 error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering`
-  --> $DIR/rename.rs:93:9
+  --> $DIR/rename.rs:95:9
    |
 LL | #![warn(clippy::invalid_atomic_ordering)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering`
 
 error: lint `clippy::invalid_ref` has been renamed to `invalid_value`
-  --> $DIR/rename.rs:94:9
+  --> $DIR/rename.rs:96:9
    |
 LL | #![warn(clippy::invalid_ref)]
    |         ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value`
 
 error: lint `clippy::invalid_utf8_in_unchecked` has been renamed to `invalid_from_utf8_unchecked`
-  --> $DIR/rename.rs:95:9
+  --> $DIR/rename.rs:97:9
    |
 LL | #![warn(clippy::invalid_utf8_in_unchecked)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_from_utf8_unchecked`
 
 error: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
-  --> $DIR/rename.rs:96:9
+  --> $DIR/rename.rs:98:9
    |
 LL | #![warn(clippy::let_underscore_drop)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
 
 error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
-  --> $DIR/rename.rs:97:9
+  --> $DIR/rename.rs:99:9
    |
 LL | #![warn(clippy::mem_discriminant_non_enum)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
 
 error: lint `clippy::panic_params` has been renamed to `non_fmt_panics`
-  --> $DIR/rename.rs:98:9
+  --> $DIR/rename.rs:100:9
    |
 LL | #![warn(clippy::panic_params)]
    |         ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics`
 
 error: lint `clippy::positional_named_format_parameters` has been renamed to `named_arguments_used_positionally`
-  --> $DIR/rename.rs:99:9
+  --> $DIR/rename.rs:101:9
    |
 LL | #![warn(clippy::positional_named_format_parameters)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `named_arguments_used_positionally`
 
 error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `temporary_cstring_as_ptr`
-  --> $DIR/rename.rs:100:9
+  --> $DIR/rename.rs:102:9
    |
 LL | #![warn(clippy::temporary_cstring_as_ptr)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `temporary_cstring_as_ptr`
 
 error: lint `clippy::undropped_manually_drops` has been renamed to `undropped_manually_drops`
-  --> $DIR/rename.rs:101:9
+  --> $DIR/rename.rs:103:9
    |
 LL | #![warn(clippy::undropped_manually_drops)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `undropped_manually_drops`
 
 error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints`
-  --> $DIR/rename.rs:102:9
+  --> $DIR/rename.rs:104:9
    |
 LL | #![warn(clippy::unknown_clippy_lints)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints`
 
 error: lint `clippy::unused_label` has been renamed to `unused_labels`
-  --> $DIR/rename.rs:103:9
+  --> $DIR/rename.rs:105:9
    |
 LL | #![warn(clippy::unused_label)]
    |         ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels`
 
-error: aborting due to 51 previous errors
+error: aborting due to 52 previous errors
 
diff --git a/tests/ui/unknown_clippy_lints.fixed b/tests/ui/unknown_clippy_lints.fixed
index 49c0e4dc7eb..debc7e152e7 100644
--- a/tests/ui/unknown_clippy_lints.fixed
+++ b/tests/ui/unknown_clippy_lints.fixed
@@ -3,7 +3,7 @@
 #![warn(clippy::pedantic)]
 // Should suggest lowercase
 #![allow(clippy::all)]
-#![warn(clippy::cmp_nan)]
+#![warn(clippy::cmp_owned)]
 
 // Should suggest similar clippy lint name
 #[warn(clippy::if_not_else)]
diff --git a/tests/ui/unknown_clippy_lints.rs b/tests/ui/unknown_clippy_lints.rs
index b60042923ea..16140fd1079 100644
--- a/tests/ui/unknown_clippy_lints.rs
+++ b/tests/ui/unknown_clippy_lints.rs
@@ -3,7 +3,7 @@
 #![warn(clippy::pedantic)]
 // Should suggest lowercase
 #![allow(clippy::All)]
-#![warn(clippy::CMP_NAN)]
+#![warn(clippy::CMP_OWNED)]
 
 // Should suggest similar clippy lint name
 #[warn(clippy::if_not_els)]
diff --git a/tests/ui/unknown_clippy_lints.stderr b/tests/ui/unknown_clippy_lints.stderr
index 584c428932f..880673eef3e 100644
--- a/tests/ui/unknown_clippy_lints.stderr
+++ b/tests/ui/unknown_clippy_lints.stderr
@@ -6,11 +6,11 @@ LL | #![allow(clippy::All)]
    |
    = note: `-D unknown-lints` implied by `-D warnings`
 
-error: unknown lint: `clippy::CMP_NAN`
+error: unknown lint: `clippy::CMP_OWNED`
   --> $DIR/unknown_clippy_lints.rs:6:9
    |
-LL | #![warn(clippy::CMP_NAN)]
-   |         ^^^^^^^^^^^^^^^ help: did you mean: `clippy::cmp_nan`
+LL | #![warn(clippy::CMP_OWNED)]
+   |         ^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::cmp_owned`
 
 error: unknown lint: `clippy::if_not_els`
   --> $DIR/unknown_clippy_lints.rs:9:8