|
1 | 1 | mod absurd_extreme_comparisons; |
2 | 2 | mod assign_op_pattern; |
3 | 3 | mod bit_mask; |
4 | | -mod cmp_nan; |
5 | 4 | mod cmp_owned; |
6 | 5 | mod double_comparison; |
7 | 6 | mod duration_subsec; |
@@ -485,31 +484,6 @@ declare_clippy_lint! { |
485 | 484 | "integer division may cause loss of precision" |
486 | 485 | } |
487 | 486 |
|
488 | | -declare_clippy_lint! { |
489 | | - /// ### What it does |
490 | | - /// Checks for comparisons to NaN. |
491 | | - /// |
492 | | - /// ### Why is this bad? |
493 | | - /// NaN does not compare meaningfully to anything – not |
494 | | - /// even itself – so those comparisons are simply wrong. |
495 | | - /// |
496 | | - /// ### Example |
497 | | - /// ```rust |
498 | | - /// # let x = 1.0; |
499 | | - /// if x == f32::NAN { } |
500 | | - /// ``` |
501 | | - /// |
502 | | - /// Use instead: |
503 | | - /// ```rust |
504 | | - /// # let x = 1.0f32; |
505 | | - /// if x.is_nan() { } |
506 | | - /// ``` |
507 | | - #[clippy::version = "pre 1.29.0"] |
508 | | - pub CMP_NAN, |
509 | | - correctness, |
510 | | - "comparisons to `NAN`, which will always return false, probably not intended" |
511 | | -} |
512 | | - |
513 | 487 | declare_clippy_lint! { |
514 | 488 | /// ### What it does |
515 | 489 | /// Checks for conversions to owned values just for the sake |
@@ -775,7 +749,6 @@ impl_lint_pass!(Operators => [ |
775 | 749 | FLOAT_EQUALITY_WITHOUT_ABS, |
776 | 750 | IDENTITY_OP, |
777 | 751 | INTEGER_DIVISION, |
778 | | - CMP_NAN, |
779 | 752 | CMP_OWNED, |
780 | 753 | FLOAT_CMP, |
781 | 754 | FLOAT_CMP_CONST, |
@@ -816,7 +789,6 @@ impl<'tcx> LateLintPass<'tcx> for Operators { |
816 | 789 | duration_subsec::check(cx, e, op.node, lhs, rhs); |
817 | 790 | float_equality_without_abs::check(cx, e, op.node, lhs, rhs); |
818 | 791 | integer_division::check(cx, e, op.node, lhs, rhs); |
819 | | - cmp_nan::check(cx, e, op.node, lhs, rhs); |
820 | 792 | cmp_owned::check(cx, op.node, lhs, rhs); |
821 | 793 | float_cmp::check(cx, e, op.node, lhs, rhs); |
822 | 794 | modulo_one::check(cx, e, op.node, rhs); |
|
0 commit comments