1 error: transmute from a type (`&T`) to itself
2 --> $DIR/transmute_ptr_to_ptr.rs:8:5
4 LL | std::mem::transmute::<&'a T, &'static T>(t)
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D clippy::useless-transmute` implied by `-D warnings`
9 error: transmute from a type (`&T`) to itself
10 --> $DIR/transmute_ptr_to_ptr.rs:13:5
12 LL | std::mem::transmute::<&'a T, &'b T>(t)
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 error: transmute from a pointer to a pointer
16 --> $DIR/transmute_ptr_to_ptr.rs:29:29
18 LL | let _: *const f32 = std::mem::transmute(ptr);
19 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
21 = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
23 error: transmute from a pointer to a pointer
24 --> $DIR/transmute_ptr_to_ptr.rs:30:27
26 LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
29 error: transmute from a reference to a reference
30 --> $DIR/transmute_ptr_to_ptr.rs:32:23
32 LL | let _: &f32 = std::mem::transmute(&1u32);
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
35 error: transmute from a reference to a reference
36 --> $DIR/transmute_ptr_to_ptr.rs:33:23
38 LL | let _: &f64 = std::mem::transmute(&1f32);
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
41 error: transmute from a reference to a reference
42 --> $DIR/transmute_ptr_to_ptr.rs:36:27
44 LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
47 error: transmute from a reference to a reference
48 --> $DIR/transmute_ptr_to_ptr.rs:37:37
50 LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
53 error: transmute from a type (`&LifetimeParam`) to itself
54 --> $DIR/transmute_ptr_to_ptr.rs:50:47
56 LL | let _: &LifetimeParam<'static> = unsafe { std::mem::transmute(&lp) };
57 | ^^^^^^^^^^^^^^^^^^^^^^^^
59 error: transmute from a type (`&GenericParam<&LifetimeParam>`) to itself
60 --> $DIR/transmute_ptr_to_ptr.rs:51:62
62 LL | let _: &GenericParam<&LifetimeParam<'static>> = unsafe { std::mem::transmute(&GenericParam { t: &lp }) };
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65 error: aborting due to 10 previous errors