@@ -590,41 +590,6 @@ declare_clippy_lint! {
590
590
"using `==` or `!=` on float values instead of comparing difference with an epsilon"
591
591
}
592
592
593
- declare_clippy_lint ! {
594
- /// ### What it does
595
- /// Checks for (in-)equality comparisons on floating-point
596
- /// value and constant, except in functions called `*eq*` (which probably
597
- /// implement equality for a type involving floats).
598
- ///
599
- /// ### Why is this bad?
600
- /// Floating point calculations are usually imprecise, so
601
- /// asking if two values are *exactly* equal is asking for trouble. For a good
602
- /// guide on what to do, see [the floating point
603
- /// guide](http://www.floating-point-gui.de/errors/comparison).
604
- ///
605
- /// ### Example
606
- /// ```no_run
607
- /// let x: f64 = 1.0;
608
- /// const ONE: f64 = 1.00;
609
- ///
610
- /// if x == ONE { } // where both are floats
611
- /// ```
612
- ///
613
- /// Use instead:
614
- /// ```no_run
615
- /// # let x: f64 = 1.0;
616
- /// # const ONE: f64 = 1.00;
617
- /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
618
- /// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
619
- /// // let error_margin = std::f64::EPSILON;
620
- /// if (x - ONE).abs() < error_margin { }
621
- /// ```
622
- #[ clippy:: version = "pre 1.29.0" ]
623
- pub FLOAT_CMP_CONST ,
624
- restriction,
625
- "using `==` or `!=` on float constants instead of comparing difference with an epsilon"
626
- }
627
-
628
593
declare_clippy_lint ! {
629
594
/// ### What it does
630
595
/// Checks for getting the remainder of a division by one or minus
@@ -802,7 +767,6 @@ impl_lint_pass!(Operators => [
802
767
INTEGER_DIVISION ,
803
768
CMP_OWNED ,
804
769
FLOAT_CMP ,
805
- FLOAT_CMP_CONST ,
806
770
MODULO_ONE ,
807
771
MODULO_ARITHMETIC ,
808
772
NEEDLESS_BITWISE_BOOL ,
0 commit comments