1 error: transmute from a pointer type (`*const T`) to a reference type (`&T`)
2 --> $DIR/transmute_ptr_to_ref.rs:4:17
4 LL | let _: &T = std::mem::transmute(p);
5 | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*p`
7 = note: `-D clippy::transmute-ptr-to-ref` implied by `-D warnings`
9 error: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
10 --> $DIR/transmute_ptr_to_ref.rs:7:21
12 LL | let _: &mut T = std::mem::transmute(m);
13 | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *m`
15 error: transmute from a pointer type (`*mut T`) to a reference type (`&T`)
16 --> $DIR/transmute_ptr_to_ref.rs:10:17
18 LL | let _: &T = std::mem::transmute(m);
19 | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*m`
21 error: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
22 --> $DIR/transmute_ptr_to_ref.rs:13:21
24 LL | let _: &mut T = std::mem::transmute(p as *mut T);
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(p as *mut T)`
27 error: transmute from a pointer type (`*const U`) to a reference type (`&T`)
28 --> $DIR/transmute_ptr_to_ref.rs:16:17
30 LL | let _: &T = std::mem::transmute(o);
31 | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(o as *const T)`
33 error: transmute from a pointer type (`*mut U`) to a reference type (`&mut T`)
34 --> $DIR/transmute_ptr_to_ref.rs:19:21
36 LL | let _: &mut T = std::mem::transmute(om);
37 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(om as *mut T)`
39 error: transmute from a pointer type (`*mut U`) to a reference type (`&T`)
40 --> $DIR/transmute_ptr_to_ref.rs:22:17
42 LL | let _: &T = std::mem::transmute(om);
43 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(om as *const T)`
45 error: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<u8>`)
46 --> $DIR/transmute_ptr_to_ref.rs:32:32
48 LL | let _: &Foo<u8> = unsafe { std::mem::transmute::<_, &Foo<_>>(raw) };
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(raw as *const Foo<_>)`
51 error: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<&u8>`)
52 --> $DIR/transmute_ptr_to_ref.rs:34:33
54 LL | let _: &Foo<&u8> = unsafe { std::mem::transmute::<_, &Foo<&_>>(raw) };
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(raw as *const Foo<&_>)`
57 error: transmute from a pointer type (`*const i32`) to a reference type (`&u8`)
58 --> $DIR/transmute_ptr_to_ref.rs:38:14
60 LL | unsafe { std::mem::transmute::<_, Bar>(raw) };
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(raw as *const u8)`
63 error: aborting due to 10 previous errors