summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/floating_point_abs.stderr
blob: db8290423ae057e50a8d5f8f8be4d678435f8e83 (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
error: manual implementation of `abs` method
  --> $DIR/floating_point_abs.rs:16:5
   |
LL |     if num >= 0.0 { num } else { -num }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
   |
   = note: `-D clippy::suboptimal-flops` implied by `-D warnings`

error: manual implementation of `abs` method
  --> $DIR/floating_point_abs.rs:20:5
   |
LL |     if 0.0 < num { num } else { -num }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`

error: manual implementation of `abs` method
  --> $DIR/floating_point_abs.rs:24:5
   |
LL |     if a.a > 0.0 { a.a } else { -a.a }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`

error: manual implementation of `abs` method
  --> $DIR/floating_point_abs.rs:28:5
   |
LL |     if 0.0 >= num { -num } else { num }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`

error: manual implementation of `abs` method
  --> $DIR/floating_point_abs.rs:32:5
   |
LL |     if a.a < 0.0 { -a.a } else { a.a }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`

error: manual implementation of negation of `abs` method
  --> $DIR/floating_point_abs.rs:36:5
   |
LL |     if num < 0.0 { num } else { -num }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`

error: manual implementation of negation of `abs` method
  --> $DIR/floating_point_abs.rs:40:5
   |
LL |     if 0.0 >= num { num } else { -num }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`

error: manual implementation of negation of `abs` method
  --> $DIR/floating_point_abs.rs:45:12
   |
LL |         a: if a.a >= 0.0 { -a.a } else { a.a },
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()`

error: aborting due to 8 previous errors