@@ -6,28 +6,28 @@ use std::f64::consts as f64;
6
6
use syntax:: ast:: { FloatTy , Lit , LitKind } ;
7
7
use syntax:: symbol;
8
8
9
- /// **What it does:** Checks for floating point literals that approximate
10
- /// constants which are defined in
11
- /// [`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)
12
- /// or
13
- /// [`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),
14
- /// respectively, suggesting to use the predefined constant.
15
- ///
16
- /// **Why is this bad?** Usually, the definition in the standard library is more
17
- /// precise than what people come up with. If you find that your definition is
18
- /// actually more precise, please [file a Rust
19
- /// issue](https://github.com/rust-lang/rust/issues).
20
- ///
21
- /// **Known problems:** If you happen to have a value that is within 1/8192 of a
22
- /// known constant, but is not *and should not* be the same, this lint will
23
- /// report your value anyway. We have not yet noticed any false positives in
24
- /// code we tested clippy with (this includes servo), but YMMV.
25
- ///
26
- /// **Example:**
27
- /// ```rust
28
- /// let x = 3.14;
29
- /// ```
30
9
declare_clippy_lint ! {
10
+ /// **What it does:** Checks for floating point literals that approximate
11
+ /// constants which are defined in
12
+ /// [`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)
13
+ /// or
14
+ /// [`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),
15
+ /// respectively, suggesting to use the predefined constant.
16
+ ///
17
+ /// **Why is this bad?** Usually, the definition in the standard library is more
18
+ /// precise than what people come up with. If you find that your definition is
19
+ /// actually more precise, please [file a Rust
20
+ /// issue](https://github.com/rust-lang/rust/issues).
21
+ ///
22
+ /// **Known problems:** If you happen to have a value that is within 1/8192 of a
23
+ /// known constant, but is not *and should not* be the same, this lint will
24
+ /// report your value anyway. We have not yet noticed any false positives in
25
+ /// code we tested clippy with (this includes servo), but YMMV.
26
+ ///
27
+ /// **Example:**
28
+ /// ```rust
29
+ /// let x = 3.14;
30
+ /// ```
31
31
pub APPROX_CONSTANT ,
32
32
correctness,
33
33
"the approximate of a known float constant (in `std::fXX::consts`)"
0 commit comments