]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/transmute_float_to_int.stderr
Rollup merge of #100462 - zohnannor:master, r=thomcc
[rust.git] / src / tools / clippy / tests / ui / transmute_float_to_int.stderr
1 error: transmute from a `f32` to a `u32`
2   --> $DIR/transmute_float_to_int.rs:4:27
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`
8
9 error: transmute from a `f32` to a `i32`
10   --> $DIR/transmute_float_to_int.rs:5:27
11    |
12 LL |     let _: i32 = unsafe { std::mem::transmute(1f32) };
13    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits() as i32`
14
15 error: transmute from a `f64` to a `u64`
16   --> $DIR/transmute_float_to_int.rs:6:27
17    |
18 LL |     let _: u64 = unsafe { std::mem::transmute(1f64) };
19    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits()`
20
21 error: transmute from a `f64` to a `i64`
22   --> $DIR/transmute_float_to_int.rs:7:27
23    |
24 LL |     let _: i64 = unsafe { std::mem::transmute(1f64) };
25    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits() as i64`
26
27 error: transmute from a `f64` to a `u64`
28   --> $DIR/transmute_float_to_int.rs:8:27
29    |
30 LL |     let _: u64 = unsafe { std::mem::transmute(1.0) };
31    |                           ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.0f64.to_bits()`
32
33 error: transmute from a `f64` to a `u64`
34   --> $DIR/transmute_float_to_int.rs:9:27
35    |
36 LL |     let _: u64 = unsafe { std::mem::transmute(-1.0) };
37    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-1.0f64).to_bits()`
38
39 error: aborting due to 6 previous errors
40