]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/floating_point_abs.stderr
Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / floating_point_abs.stderr
1 error: manual implementation of `abs` method
2   --> $DIR/floating_point_abs.rs:16:5
3    |
4 LL |     if num >= 0.0 { num } else { -num }
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
6    |
7    = note: `-D clippy::suboptimal-flops` implied by `-D warnings`
8
9 error: manual implementation of `abs` method
10   --> $DIR/floating_point_abs.rs:20:5
11    |
12 LL |     if 0.0 < num { num } else { -num }
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
14
15 error: manual implementation of `abs` method
16   --> $DIR/floating_point_abs.rs:24:5
17    |
18 LL |     if a.a > 0.0 { a.a } else { -a.a }
19    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
20
21 error: manual implementation of `abs` method
22   --> $DIR/floating_point_abs.rs:28:5
23    |
24 LL |     if 0.0 >= num { -num } else { num }
25    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
26
27 error: manual implementation of `abs` method
28   --> $DIR/floating_point_abs.rs:32:5
29    |
30 LL |     if a.a < 0.0 { -a.a } else { a.a }
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
32
33 error: manual implementation of negation of `abs` method
34   --> $DIR/floating_point_abs.rs:36:5
35    |
36 LL |     if num < 0.0 { num } else { -num }
37    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
38
39 error: manual implementation of negation of `abs` method
40   --> $DIR/floating_point_abs.rs:40:5
41    |
42 LL |     if 0.0 >= num { num } else { -num }
43    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
44
45 error: manual implementation of negation of `abs` method
46   --> $DIR/floating_point_abs.rs:45:12
47    |
48 LL |         a: if a.a >= 0.0 { -a.a } else { a.a },
49    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()`
50
51 error: aborting due to 8 previous errors
52