summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/floating_point_log.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/floating_point_log.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/floating_point_log.stderr')
-rw-r--r--src/tools/clippy/tests/ui/floating_point_log.stderr174
1 files changed, 174 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/floating_point_log.stderr b/src/tools/clippy/tests/ui/floating_point_log.stderr
new file mode 100644
index 000000000..96e5a1544
--- /dev/null
+++ b/src/tools/clippy/tests/ui/floating_point_log.stderr
@@ -0,0 +1,174 @@
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:10:13
+ |
+LL | let _ = x.log(2f32);
+ | ^^^^^^^^^^^ help: consider using: `x.log2()`
+ |
+ = note: `-D clippy::suboptimal-flops` implied by `-D warnings`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:11:13
+ |
+LL | let _ = x.log(10f32);
+ | ^^^^^^^^^^^^ help: consider using: `x.log10()`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:12:13
+ |
+LL | let _ = x.log(std::f32::consts::E);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.ln()`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:13:13
+ |
+LL | let _ = x.log(TWO);
+ | ^^^^^^^^^^ help: consider using: `x.log2()`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:14:13
+ |
+LL | let _ = x.log(E);
+ | ^^^^^^^^ help: consider using: `x.ln()`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:17:13
+ |
+LL | let _ = x.log(2f64);
+ | ^^^^^^^^^^^ help: consider using: `x.log2()`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:18:13
+ |
+LL | let _ = x.log(10f64);
+ | ^^^^^^^^^^^^ help: consider using: `x.log10()`
+
+error: logarithm for bases 2, 10 and e can be computed more accurately
+ --> $DIR/floating_point_log.rs:19:13
+ |
+LL | let _ = x.log(std::f64::consts::E);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.ln()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:24:13
+ |
+LL | let _ = (1f32 + 2.).ln();
+ | ^^^^^^^^^^^^^^^^ help: consider using: `2.0f32.ln_1p()`
+ |
+ = note: `-D clippy::imprecise-flops` implied by `-D warnings`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:25:13
+ |
+LL | let _ = (1f32 + 2.0).ln();
+ | ^^^^^^^^^^^^^^^^^ help: consider using: `2.0f32.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:26:13
+ |
+LL | let _ = (1.0 + x).ln();
+ | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:27:13
+ |
+LL | let _ = (1.0 + x / 2.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:28:13
+ |
+LL | let _ = (1.0 + x.powi(3)).ln();
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:29:13
+ |
+LL | let _ = (1.0 + x.powi(3) / 2.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x.powi(3) / 2.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:30:13
+ |
+LL | let _ = (1.0 + (std::f32::consts::E - 1.0)).ln();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(std::f32::consts::E - 1.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:31:13
+ |
+LL | let _ = (x + 1.0).ln();
+ | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:32:13
+ |
+LL | let _ = (x.powi(3) + 1.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:33:13
+ |
+LL | let _ = (x + 2.0 + 1.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x + 2.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:34:13
+ |
+LL | let _ = (x / 2.0 + 1.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:42:13
+ |
+LL | let _ = (1f64 + 2.).ln();
+ | ^^^^^^^^^^^^^^^^ help: consider using: `2.0f64.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:43:13
+ |
+LL | let _ = (1f64 + 2.0).ln();
+ | ^^^^^^^^^^^^^^^^^ help: consider using: `2.0f64.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:44:13
+ |
+LL | let _ = (1.0 + x).ln();
+ | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:45:13
+ |
+LL | let _ = (1.0 + x / 2.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:46:13
+ |
+LL | let _ = (1.0 + x.powi(3)).ln();
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:47:13
+ |
+LL | let _ = (x + 1.0).ln();
+ | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:48:13
+ |
+LL | let _ = (x.powi(3) + 1.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:49:13
+ |
+LL | let _ = (x + 2.0 + 1.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x + 2.0).ln_1p()`
+
+error: ln(1 + x) can be computed more accurately
+ --> $DIR/floating_point_log.rs:50:13
+ |
+LL | let _ = (x / 2.0 + 1.0).ln();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
+
+error: aborting due to 28 previous errors
+