]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/floating_point_abs.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / floating_point_abs.stderr
diff --git a/src/tools/clippy/tests/ui/floating_point_abs.stderr b/src/tools/clippy/tests/ui/floating_point_abs.stderr
new file mode 100644 (file)
index 0000000..35af702
--- /dev/null
@@ -0,0 +1,52 @@
+error: manual implementation of `abs` method
+  --> $DIR/floating_point_abs.rs:10: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:14:5
+   |
+LL |     if 0.0 < num { num } else { -num }
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
+
+error: manual implementation of `abs` method
+  --> $DIR/floating_point_abs.rs:18: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:22:5
+   |
+LL |     if 0.0 >= num { -num } else { num }
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
+
+error: manual implementation of `abs` method
+  --> $DIR/floating_point_abs.rs:26: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:30: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:34: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:39: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
+