rust/tests/ui/floating_point_abs.stderr

53 lines
1.7 KiB
Plaintext
Raw Normal View History

2020-03-03 17:52:53 -06:00
error: manual implementation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:15:5
2020-02-28 14:40:13 -06:00
|
LL | if num >= 0.0 { num } else { -num }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
2020-02-28 14:40:13 -06:00
|
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
2020-03-03 17:52:53 -06:00
error: manual implementation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:19:5
|
LL | if 0.0 < num { num } else { -num }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
2020-03-03 17:52:53 -06:00
error: manual implementation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:23:5
|
LL | if a.a > 0.0 { a.a } else { -a.a }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
2020-03-03 17:52:53 -06:00
error: manual implementation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:27:5
|
LL | if 0.0 >= num { -num } else { num }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
2020-03-03 17:52:53 -06:00
error: manual implementation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:31:5
|
LL | if a.a < 0.0 { -a.a } else { a.a }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
2020-03-03 17:52:53 -06:00
error: manual implementation of negation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:35:5
|
LL | if num < 0.0 { num } else { -num }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
2020-03-03 17:52:53 -06:00
error: manual implementation of negation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:39:5
|
LL | if 0.0 >= num { num } else { -num }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
2020-03-03 17:52:53 -06:00
error: manual implementation of negation of `abs` method
2023-07-27 06:40:22 -05:00
--> $DIR/floating_point_abs.rs:44: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
2020-02-28 14:40:13 -06:00