mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-22 02:53:20 +00:00
52 lines
1.5 KiB
Text
52 lines
1.5 KiB
Text
error: casting a known NaN to usize
|
|
--> tests/ui/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`
|
|
= help: to override `-D warnings` add `#[allow(clippy::cast_nan_to_int)]`
|
|
|
|
error: casting a known NaN to usize
|
|
--> tests/ui/cast_nan_to_int.rs:8:13
|
|
|
|
|
LL | let _ = (f64::INFINITY * -0.0) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this always evaluates to 0
|
|
|
|
error: casting a known NaN to usize
|
|
--> tests/ui/cast_nan_to_int.rs:11:13
|
|
|
|
|
LL | let _ = (0.0 * f32::INFINITY) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this always evaluates to 0
|
|
|
|
error: casting a known NaN to usize
|
|
--> tests/ui/cast_nan_to_int.rs:15:13
|
|
|
|
|
LL | let _ = (f64::INFINITY + f64::NEG_INFINITY) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this always evaluates to 0
|
|
|
|
error: casting a known NaN to usize
|
|
--> tests/ui/cast_nan_to_int.rs:18:13
|
|
|
|
|
LL | let _ = (f32::INFINITY - f32::INFINITY) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this always evaluates to 0
|
|
|
|
error: casting a known NaN to usize
|
|
--> tests/ui/cast_nan_to_int.rs:21:13
|
|
|
|
|
LL | let _ = (f32::INFINITY / f32::NEG_INFINITY) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this always evaluates to 0
|
|
|
|
error: aborting due to 6 previous errors
|
|
|