]>
Commit | Line | Data |
---|---|---|
f20569fa | 1 | error: transmute from a `f32` to a `u32` |
94222f64 | 2 | --> $DIR/transmute_float_to_int.rs:4:27 |
f20569fa XL |
3 | | |
4 | LL | let _: u32 = unsafe { std::mem::transmute(1f32) }; | |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits()` | |
6 | | | |
7 | = note: `-D clippy::transmute-float-to-int` implied by `-D warnings` | |
781aab86 | 8 | = help: to override `-D warnings` add `#[allow(clippy::transmute_float_to_int)]` |
f20569fa XL |
9 | |
10 | error: transmute from a `f32` to a `i32` | |
781aab86 | 11 | --> $DIR/transmute_float_to_int.rs:7:27 |
f20569fa XL |
12 | | |
13 | LL | let _: i32 = unsafe { std::mem::transmute(1f32) }; | |
14 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits() as i32` | |
15 | ||
16 | error: transmute from a `f64` to a `u64` | |
781aab86 | 17 | --> $DIR/transmute_float_to_int.rs:9:27 |
f20569fa XL |
18 | | |
19 | LL | let _: u64 = unsafe { std::mem::transmute(1f64) }; | |
20 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits()` | |
21 | ||
22 | error: transmute from a `f64` to a `i64` | |
781aab86 | 23 | --> $DIR/transmute_float_to_int.rs:11:27 |
f20569fa XL |
24 | | |
25 | LL | let _: i64 = unsafe { std::mem::transmute(1f64) }; | |
26 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits() as i64` | |
27 | ||
28 | error: transmute from a `f64` to a `u64` | |
781aab86 | 29 | --> $DIR/transmute_float_to_int.rs:13:27 |
f20569fa XL |
30 | | |
31 | LL | let _: u64 = unsafe { std::mem::transmute(1.0) }; | |
32 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.0f64.to_bits()` | |
33 | ||
34 | error: transmute from a `f64` to a `u64` | |
781aab86 | 35 | --> $DIR/transmute_float_to_int.rs:15:27 |
f20569fa XL |
36 | | |
37 | LL | let _: u64 = unsafe { std::mem::transmute(-1.0) }; | |
38 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-1.0f64).to_bits()` | |
39 | ||
40 | error: aborting due to 6 previous errors | |
41 |