summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/float_equality_without_abs.stderr
blob: b34c8159da04db8c2258f29d1214418d166e9676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:4:5
   |
LL |     (a - b) < f32::EPSILON
   |     -------^^^^^^^^^^^^^^^
   |     |
   |     help: add `.abs()`: `(a - b).abs()`
   |
   = note: `-D clippy::float-equality-without-abs` implied by `-D warnings`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:13:13
   |
LL |     let _ = (a - b) < f32::EPSILON;
   |             -------^^^^^^^^^^^^^^^
   |             |
   |             help: add `.abs()`: `(a - b).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:14:13
   |
LL |     let _ = a - b < f32::EPSILON;
   |             -----^^^^^^^^^^^^^^^
   |             |
   |             help: add `.abs()`: `(a - b).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:15:13
   |
LL |     let _ = a - b.abs() < f32::EPSILON;
   |             -----------^^^^^^^^^^^^^^^
   |             |
   |             help: add `.abs()`: `(a - b.abs()).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:16:13
   |
LL |     let _ = (a as f64 - b as f64) < f64::EPSILON;
   |             ---------------------^^^^^^^^^^^^^^^
   |             |
   |             help: add `.abs()`: `(a as f64 - b as f64).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:17:13
   |
LL |     let _ = 1.0 - 2.0 < f32::EPSILON;
   |             ---------^^^^^^^^^^^^^^^
   |             |
   |             help: add `.abs()`: `(1.0 - 2.0).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:19:13
   |
LL |     let _ = f32::EPSILON > (a - b);
   |             ^^^^^^^^^^^^^^^-------
   |                            |
   |                            help: add `.abs()`: `(a - b).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:20:13
   |
LL |     let _ = f32::EPSILON > a - b;
   |             ^^^^^^^^^^^^^^^-----
   |                            |
   |                            help: add `.abs()`: `(a - b).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:21:13
   |
LL |     let _ = f32::EPSILON > a - b.abs();
   |             ^^^^^^^^^^^^^^^-----------
   |                            |
   |                            help: add `.abs()`: `(a - b.abs()).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:22:13
   |
LL |     let _ = f64::EPSILON > (a as f64 - b as f64);
   |             ^^^^^^^^^^^^^^^---------------------
   |                            |
   |                            help: add `.abs()`: `(a as f64 - b as f64).abs()`

error: float equality check without `.abs()`
  --> $DIR/float_equality_without_abs.rs:23:13
   |
LL |     let _ = f32::EPSILON > 1.0 - 2.0;
   |             ^^^^^^^^^^^^^^^---------
   |                            |
   |                            help: add `.abs()`: `(1.0 - 2.0).abs()`

error: aborting due to 11 previous errors