2
0
Fork 0
mirror of https://github.com/rust-lang/rust-clippy synced 2024-12-25 20:43:18 +00:00
rust-clippy/tests/ui/transmute_float_to_int.stderr

42 lines
1.7 KiB
Text
Raw Normal View History

error: transmute from a `f32` to a `u32`
2024-02-17 12:16:29 +00:00
--> tests/ui/transmute_float_to_int.rs:4:27
|
LL | let _: u32 = unsafe { std::mem::transmute(1f32) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits()`
|
= note: `-D clippy::transmute-float-to-int` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::transmute_float_to_int)]`
error: transmute from a `f32` to a `i32`
2024-02-17 12:16:29 +00:00
--> tests/ui/transmute_float_to_int.rs:7:27
|
LL | let _: i32 = unsafe { std::mem::transmute(1f32) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits() as i32`
error: transmute from a `f64` to a `u64`
2024-02-17 12:16:29 +00:00
--> tests/ui/transmute_float_to_int.rs:9:27
|
LL | let _: u64 = unsafe { std::mem::transmute(1f64) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits()`
error: transmute from a `f64` to a `i64`
2024-02-17 12:16:29 +00:00
--> tests/ui/transmute_float_to_int.rs:11:27
|
LL | let _: i64 = unsafe { std::mem::transmute(1f64) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits() as i64`
error: transmute from a `f64` to a `u64`
2024-02-17 12:16:29 +00:00
--> tests/ui/transmute_float_to_int.rs:13:27
|
LL | let _: u64 = unsafe { std::mem::transmute(1.0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.0f64.to_bits()`
error: transmute from a `f64` to a `u64`
2024-02-17 12:16:29 +00:00
--> tests/ui/transmute_float_to_int.rs:15:27
|
LL | let _: u64 = unsafe { std::mem::transmute(-1.0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-1.0f64).to_bits()`
error: aborting due to 6 previous errors