2019-12-07 18:59:17 -06:00
|
|
|
error: transmute from a `f32` to a `u32`
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/transmute_float_to_int.rs:5:27
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
|
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`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::transmute_float_to_int)]`
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
error: transmute from a `f32` to a `i32`
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/transmute_float_to_int.rs:8:27
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
|
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-19 07:53:53 -06:00
|
|
|
--> tests/ui/transmute_float_to_int.rs:10:27
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
|
LL | let _: u64 = unsafe { std::mem::transmute(1f64) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits()`
|
|
|
|
|
|
|
|
error: transmute from a `f64` to a `i64`
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/transmute_float_to_int.rs:12:27
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
|
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-19 07:53:53 -06:00
|
|
|
--> tests/ui/transmute_float_to_int.rs:14:27
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
|
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-19 07:53:53 -06:00
|
|
|
--> tests/ui/transmute_float_to_int.rs:16:27
|
2019-12-07 18:59:17 -06:00
|
|
|
|
|
|
|
|
LL | let _: u64 = unsafe { std::mem::transmute(-1.0) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-1.0f64).to_bits()`
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|