]> git.lizzy.rs Git - rust.git/blob - tests/ui/transmute_ptr_to_ptr.stderr
[`excessive_bools`] lint trait functions even without bodies
[rust.git] / tests / ui / transmute_ptr_to_ptr.stderr
1 error: transmute from a pointer to a pointer
2   --> $DIR/transmute_ptr_to_ptr.rs:30:29
3    |
4 LL |         let _: *const f32 = std::mem::transmute(ptr);
5    |                             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
6    |
7    = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
8
9 error: transmute from a pointer to a pointer
10   --> $DIR/transmute_ptr_to_ptr.rs:31:27
11    |
12 LL |         let _: *mut f32 = std::mem::transmute(mut_ptr);
13    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
14
15 error: transmute from a reference to a reference
16   --> $DIR/transmute_ptr_to_ptr.rs:33:23
17    |
18 LL |         let _: &f32 = std::mem::transmute(&1u32);
19    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
20
21 error: transmute from a reference to a reference
22   --> $DIR/transmute_ptr_to_ptr.rs:34:23
23    |
24 LL |         let _: &f64 = std::mem::transmute(&1f32);
25    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
26
27 error: transmute from a reference to a reference
28   --> $DIR/transmute_ptr_to_ptr.rs:37:27
29    |
30 LL |         let _: &mut f32 = std::mem::transmute(&mut 1u32);
31    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
32
33 error: transmute from a reference to a reference
34   --> $DIR/transmute_ptr_to_ptr.rs:38:37
35    |
36 LL |         let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
37    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
38
39 error: aborting due to 6 previous errors
40