summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/cast_nan_to_int.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/cast_nan_to_int.stderr51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/cast_nan_to_int.stderr b/src/tools/clippy/tests/ui/cast_nan_to_int.stderr
new file mode 100644
index 000000000..3539be75a
--- /dev/null
+++ b/src/tools/clippy/tests/ui/cast_nan_to_int.stderr
@@ -0,0 +1,51 @@
+error: casting a known NaN to usize
+ --> $DIR/cast_nan_to_int.rs:5:13
+ |
+LL | let _ = (0.0_f32 / -0.0) as usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this always evaluates to 0
+ = note: `-D clippy::cast-nan-to-int` implied by `-D warnings`
+
+error: casting a known NaN to usize
+ --> $DIR/cast_nan_to_int.rs:6:13
+ |
+LL | let _ = (f64::INFINITY * -0.0) as usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this always evaluates to 0
+
+error: casting a known NaN to usize
+ --> $DIR/cast_nan_to_int.rs:7:13
+ |
+LL | let _ = (0.0 * f32::INFINITY) as usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this always evaluates to 0
+
+error: casting a known NaN to usize
+ --> $DIR/cast_nan_to_int.rs:9:13
+ |
+LL | let _ = (f64::INFINITY + f64::NEG_INFINITY) as usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this always evaluates to 0
+
+error: casting a known NaN to usize
+ --> $DIR/cast_nan_to_int.rs:10:13
+ |
+LL | let _ = (f32::INFINITY - f32::INFINITY) as usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this always evaluates to 0
+
+error: casting a known NaN to usize
+ --> $DIR/cast_nan_to_int.rs:11:13
+ |
+LL | let _ = (f32::INFINITY / f32::NEG_INFINITY) as usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this always evaluates to 0
+
+error: aborting due to 6 previous errors
+