|
1 | 1 | error: transmute from a pointer type (`*const T`) to a reference type (`&T`) |
2 | | - --> $DIR/transmute_ptr_to_ref.rs:7:17 |
| 2 | + --> $DIR/transmute_ptr_to_ref.rs:8:17 |
3 | 3 | | |
4 | 4 | LL | let _: &T = std::mem::transmute(p); |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*p` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::transmute-ptr-to-ref` implied by `-D warnings` |
8 | 8 |
|
9 | 9 | error: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`) |
10 | | - --> $DIR/transmute_ptr_to_ref.rs:10:21 |
| 10 | + --> $DIR/transmute_ptr_to_ref.rs:11:21 |
11 | 11 | | |
12 | 12 | LL | let _: &mut T = std::mem::transmute(m); |
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *m` |
14 | 14 |
|
15 | 15 | error: transmute from a pointer type (`*mut T`) to a reference type (`&T`) |
16 | | - --> $DIR/transmute_ptr_to_ref.rs:13:17 |
| 16 | + --> $DIR/transmute_ptr_to_ref.rs:14:17 |
17 | 17 | | |
18 | 18 | LL | let _: &T = std::mem::transmute(m); |
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*m` |
20 | 20 |
|
21 | 21 | error: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`) |
22 | | - --> $DIR/transmute_ptr_to_ref.rs:16:21 |
| 22 | + --> $DIR/transmute_ptr_to_ref.rs:17:21 |
23 | 23 | | |
24 | 24 | LL | let _: &mut T = std::mem::transmute(p as *mut T); |
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(p as *mut T)` |
26 | 26 |
|
27 | 27 | error: transmute from a pointer type (`*const U`) to a reference type (`&T`) |
28 | | - --> $DIR/transmute_ptr_to_ref.rs:19:17 |
| 28 | + --> $DIR/transmute_ptr_to_ref.rs:20:17 |
29 | 29 | | |
30 | 30 | LL | let _: &T = std::mem::transmute(o); |
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(o as *const T)` |
32 | 32 |
|
33 | 33 | error: transmute from a pointer type (`*mut U`) to a reference type (`&mut T`) |
34 | | - --> $DIR/transmute_ptr_to_ref.rs:22:21 |
| 34 | + --> $DIR/transmute_ptr_to_ref.rs:23:21 |
35 | 35 | | |
36 | 36 | LL | let _: &mut T = std::mem::transmute(om); |
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(om as *mut T)` |
38 | 38 |
|
39 | 39 | error: transmute from a pointer type (`*mut U`) to a reference type (`&T`) |
40 | | - --> $DIR/transmute_ptr_to_ref.rs:25:17 |
| 40 | + --> $DIR/transmute_ptr_to_ref.rs:26:17 |
41 | 41 | | |
42 | 42 | LL | let _: &T = std::mem::transmute(om); |
43 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(om as *const T)` |
44 | 44 |
|
45 | 45 | error: transmute from a pointer type (`*const i32`) to a reference type (`&_issue1231::Foo<'_, u8>`) |
46 | | - --> $DIR/transmute_ptr_to_ref.rs:35:32 |
| 46 | + --> $DIR/transmute_ptr_to_ref.rs:36:32 |
47 | 47 | | |
48 | 48 | LL | let _: &Foo<u8> = unsafe { std::mem::transmute::<_, &Foo<_>>(raw) }; |
49 | 49 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*raw.cast::<Foo<_>>()` |
50 | 50 |
|
51 | 51 | error: transmute from a pointer type (`*const i32`) to a reference type (`&_issue1231::Foo<'_, &u8>`) |
52 | | - --> $DIR/transmute_ptr_to_ref.rs:37:33 |
| 52 | + --> $DIR/transmute_ptr_to_ref.rs:38:33 |
53 | 53 | | |
54 | 54 | LL | let _: &Foo<&u8> = unsafe { std::mem::transmute::<_, &Foo<&_>>(raw) }; |
55 | 55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*raw.cast::<Foo<&_>>()` |
56 | 56 |
|
57 | 57 | error: transmute from a pointer type (`*const i32`) to a reference type (`&u8`) |
58 | | - --> $DIR/transmute_ptr_to_ref.rs:41:14 |
| 58 | + --> $DIR/transmute_ptr_to_ref.rs:42:22 |
59 | 59 | | |
60 | | -LL | unsafe { std::mem::transmute::<_, Bar>(raw) }; |
61 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(raw as *const u8)` |
| 60 | +LL | let _ = unsafe { std::mem::transmute::<_, Bar>(raw) }; |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(raw as *const u8)` |
62 | 62 |
|
63 | 63 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
64 | | - --> $DIR/transmute_ptr_to_ref.rs:46:14 |
| 64 | + --> $DIR/transmute_ptr_to_ref.rs:47:14 |
65 | 65 | | |
66 | 66 | LL | 0 => std::mem::transmute(x), |
67 | 67 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*x.cast::<&u32>()` |
68 | 68 |
|
69 | 69 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
70 | | - --> $DIR/transmute_ptr_to_ref.rs:47:14 |
| 70 | + --> $DIR/transmute_ptr_to_ref.rs:48:14 |
71 | 71 | | |
72 | 72 | LL | 1 => std::mem::transmute(y), |
73 | 73 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*y.cast::<&u32>()` |
74 | 74 |
|
75 | 75 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
76 | | - --> $DIR/transmute_ptr_to_ref.rs:48:14 |
| 76 | + --> $DIR/transmute_ptr_to_ref.rs:49:14 |
77 | 77 | | |
78 | 78 | LL | 2 => std::mem::transmute::<_, &&'b u32>(x), |
79 | 79 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*x.cast::<&'b u32>()` |
80 | 80 |
|
81 | 81 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
82 | | - --> $DIR/transmute_ptr_to_ref.rs:49:14 |
| 82 | + --> $DIR/transmute_ptr_to_ref.rs:50:14 |
83 | 83 | | |
84 | 84 | LL | _ => std::mem::transmute::<_, &&'b u32>(y), |
85 | 85 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*y.cast::<&'b u32>()` |
86 | 86 |
|
87 | 87 | error: transmute from a pointer type (`*const u32`) to a reference type (`&u32`) |
88 | | - --> $DIR/transmute_ptr_to_ref.rs:57:19 |
| 88 | + --> $DIR/transmute_ptr_to_ref.rs:58:19 |
89 | 89 | | |
90 | 90 | LL | let _: &u32 = std::mem::transmute(a); |
91 | 91 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*a` |
92 | 92 |
|
93 | 93 | error: transmute from a pointer type (`*const u32`) to a reference type (`&u32`) |
94 | | - --> $DIR/transmute_ptr_to_ref.rs:58:19 |
| 94 | + --> $DIR/transmute_ptr_to_ref.rs:59:19 |
95 | 95 | | |
96 | 96 | LL | let _: &u32 = std::mem::transmute::<_, &u32>(a); |
97 | 97 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*a.cast::<u32>()` |
98 | 98 |
|
99 | 99 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
100 | | - --> $DIR/transmute_ptr_to_ref.rs:60:14 |
| 100 | + --> $DIR/transmute_ptr_to_ref.rs:61:14 |
101 | 101 | | |
102 | 102 | LL | 0 => std::mem::transmute(x), |
103 | 103 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*x.cast::<&u32>()` |
104 | 104 |
|
105 | 105 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
106 | | - --> $DIR/transmute_ptr_to_ref.rs:61:14 |
| 106 | + --> $DIR/transmute_ptr_to_ref.rs:62:14 |
107 | 107 | | |
108 | 108 | LL | _ => std::mem::transmute::<_, &&'b u32>(x), |
109 | 109 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*x.cast::<&'b u32>()` |
110 | 110 |
|
111 | 111 | error: transmute from a pointer type (`*const u32`) to a reference type (`&u32`) |
112 | | - --> $DIR/transmute_ptr_to_ref.rs:69:19 |
| 112 | + --> $DIR/transmute_ptr_to_ref.rs:70:19 |
113 | 113 | | |
114 | 114 | LL | let _: &u32 = std::mem::transmute(a); |
115 | 115 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*a` |
116 | 116 |
|
117 | 117 | error: transmute from a pointer type (`*const u32`) to a reference type (`&u32`) |
118 | | - --> $DIR/transmute_ptr_to_ref.rs:70:19 |
| 118 | + --> $DIR/transmute_ptr_to_ref.rs:71:19 |
119 | 119 | | |
120 | 120 | LL | let _: &u32 = std::mem::transmute::<_, &u32>(a); |
121 | 121 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(a as *const u32)` |
122 | 122 |
|
123 | 123 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
124 | | - --> $DIR/transmute_ptr_to_ref.rs:72:14 |
| 124 | + --> $DIR/transmute_ptr_to_ref.rs:73:14 |
125 | 125 | | |
126 | 126 | LL | 0 => std::mem::transmute(x), |
127 | 127 | | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(x as *const () as *const &u32)` |
128 | 128 |
|
129 | 129 | error: transmute from a pointer type (`*const &u32`) to a reference type (`&&u32`) |
130 | | - --> $DIR/transmute_ptr_to_ref.rs:73:14 |
| 130 | + --> $DIR/transmute_ptr_to_ref.rs:74:14 |
131 | 131 | | |
132 | 132 | LL | _ => std::mem::transmute::<_, &&'b u32>(x), |
133 | 133 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(x as *const () as *const &'b u32)` |
|
0 commit comments