summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/lossy_float_literal.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/lossy_float_literal.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/lossy_float_literal.stderr')
-rw-r--r--src/tools/clippy/tests/ui/lossy_float_literal.stderr70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/lossy_float_literal.stderr b/src/tools/clippy/tests/ui/lossy_float_literal.stderr
new file mode 100644
index 000000000..d2193c0c8
--- /dev/null
+++ b/src/tools/clippy/tests/ui/lossy_float_literal.stderr
@@ -0,0 +1,70 @@
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:6:18
+ |
+LL | let _: f32 = 16_777_217.0;
+ | ^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_216.0`
+ |
+ = note: `-D clippy::lossy-float-literal` implied by `-D warnings`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:7:18
+ |
+LL | let _: f32 = 16_777_219.0;
+ | ^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:8:18
+ |
+LL | let _: f32 = 16_777_219.;
+ | ^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:9:18
+ |
+LL | let _: f32 = 16_777_219.000;
+ | ^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:10:13
+ |
+LL | let _ = 16_777_219f32;
+ | ^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220_f32`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:11:19
+ |
+LL | let _: f32 = -16_777_219.0;
+ | ^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:12:18
+ |
+LL | let _: f64 = 9_007_199_254_740_993.0;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:13:18
+ |
+LL | let _: f64 = 9_007_199_254_740_993.;
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:14:18
+ |
+LL | let _: f64 = 9_007_199_254_740_993.00;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:15:13
+ |
+LL | let _ = 9_007_199_254_740_993f64;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992_f64`
+
+error: literal cannot be represented as the underlying type without loss of precision
+ --> $DIR/lossy_float_literal.rs:16:19
+ |
+LL | let _: f64 = -9_007_199_254_740_993.0;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
+
+error: aborting due to 11 previous errors
+