11error: transmute from a pointer to a pointer
2- --> tests/ui/transmute_ptr_to_ptr.rs:32 :29
2+ --> tests/ui/transmute_ptr_to_ptr.rs:39 :29
33 |
44LL | let _: *const f32 = transmute(ptr);
55 | ^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL + let _: *const f32 = ptr.cast::<f32>();
1313 |
1414
1515error: transmute from a pointer to a pointer
16- --> tests/ui/transmute_ptr_to_ptr.rs:35 :27
16+ --> tests/ui/transmute_ptr_to_ptr.rs:42 :27
1717 |
1818LL | let _: *mut f32 = transmute(mut_ptr);
1919 | ^^^^^^^^^^^^^^^^^^
@@ -25,37 +25,37 @@ LL + let _: *mut f32 = mut_ptr.cast::<f32>();
2525 |
2626
2727error: transmute from a reference to a reference
28- --> tests/ui/transmute_ptr_to_ptr.rs:39 :23
28+ --> tests/ui/transmute_ptr_to_ptr.rs:46 :23
2929 |
3030LL | let _: &f32 = transmute(&1u32);
3131 | ^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
3232
3333error: transmute from a reference to a reference
34- --> tests/ui/transmute_ptr_to_ptr.rs:42 :23
34+ --> tests/ui/transmute_ptr_to_ptr.rs:49 :23
3535 |
3636LL | let _: &f32 = transmute(&1f64);
3737 | ^^^^^^^^^^^^^^^^ help: try: `&*(&1f64 as *const f64 as *const f32)`
3838
3939error: transmute from a reference to a reference
40- --> tests/ui/transmute_ptr_to_ptr.rs:47 :27
40+ --> tests/ui/transmute_ptr_to_ptr.rs:54 :27
4141 |
4242LL | let _: &mut f32 = transmute(&mut 1u32);
4343 | ^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
4444
4545error: transmute from a reference to a reference
46- --> tests/ui/transmute_ptr_to_ptr.rs:50 :37
46+ --> tests/ui/transmute_ptr_to_ptr.rs:57 :37
4747 |
4848LL | let _: &GenericParam<f32> = transmute(&GenericParam { t: 1u32 });
4949 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
5050
5151error: transmute from a reference to a reference
52- --> tests/ui/transmute_ptr_to_ptr.rs:54 :27
52+ --> tests/ui/transmute_ptr_to_ptr.rs:61 :27
5353 |
5454LL | let u8_ref: &u8 = transmute(u64_ref);
5555 | ^^^^^^^^^^^^^^^^^^ help: try: `&*(u64_ref as *const u64 as *const u8)`
5656
5757error: transmute from a pointer to a pointer
58- --> tests/ui/transmute_ptr_to_ptr.rs:57 :29
58+ --> tests/ui/transmute_ptr_to_ptr.rs:64 :29
5959 |
6060LL | let _: *const u32 = transmute(mut_ptr);
6161 | ^^^^^^^^^^^^^^^^^^
@@ -67,7 +67,7 @@ LL + let _: *const u32 = mut_ptr.cast_const();
6767 |
6868
6969error: transmute from a pointer to a pointer
70- --> tests/ui/transmute_ptr_to_ptr.rs:60 :27
70+ --> tests/ui/transmute_ptr_to_ptr.rs:67 :27
7171 |
7272LL | let _: *mut u32 = transmute(ptr);
7373 | ^^^^^^^^^^^^^^
@@ -79,7 +79,43 @@ LL + let _: *mut u32 = ptr.cast_mut();
7979 |
8080
8181error: transmute from a pointer to a pointer
82- --> tests/ui/transmute_ptr_to_ptr.rs:72:14
82+ --> tests/ui/transmute_ptr_to_ptr.rs:81:29
83+ |
84+ LL | let _: *const f32 = transmute(Ptr(ptr));
85+ | ^^^^^^^^^^^^^^^^^^^
86+ |
87+ help: use `pointer::cast` instead
88+ |
89+ LL - let _: *const f32 = transmute(Ptr(ptr));
90+ LL + let _: *const f32 = Ptr(ptr).0.cast::<f32>();
91+ |
92+
93+ error: transmute from a pointer to a pointer
94+ --> tests/ui/transmute_ptr_to_ptr.rs:83:29
95+ |
96+ LL | let _: *const f32 = transmute(PtrNamed { ptr });
97+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
98+ |
99+ help: use `pointer::cast` instead
100+ |
101+ LL - let _: *const f32 = transmute(PtrNamed { ptr });
102+ LL + let _: *const f32 = PtrNamed { ptr }.ptr.cast::<f32>();
103+ |
104+
105+ error: transmute from a pointer to a pointer
106+ --> tests/ui/transmute_ptr_to_ptr.rs:85:27
107+ |
108+ LL | let _: *mut u32 = transmute(Ptr(ptr));
109+ | ^^^^^^^^^^^^^^^^^^^
110+ |
111+ help: use `pointer::cast_mut` instead
112+ |
113+ LL - let _: *mut u32 = transmute(Ptr(ptr));
114+ LL + let _: *mut u32 = Ptr(ptr).0.cast_mut();
115+ |
116+
117+ error: transmute from a pointer to a pointer
118+ --> tests/ui/transmute_ptr_to_ptr.rs:91:14
83119 |
84120LL | unsafe { transmute(v) }
85121 | ^^^^^^^^^^^^
@@ -91,7 +127,7 @@ LL + unsafe { v as *const &() }
91127 |
92128
93129error: transmute from a pointer to a pointer
94- --> tests/ui/transmute_ptr_to_ptr.rs:87 :28
130+ --> tests/ui/transmute_ptr_to_ptr.rs:108 :28
95131 |
96132LL | let _: *const i8 = transmute(ptr);
97133 | ^^^^^^^^^^^^^^
@@ -103,7 +139,19 @@ LL + let _: *const i8 = ptr as *const i8;
103139 |
104140
105141error: transmute from a pointer to a pointer
106- --> tests/ui/transmute_ptr_to_ptr.rs:95:28
142+ --> tests/ui/transmute_ptr_to_ptr.rs:110:28
143+ |
144+ LL | let _: *const i8 = transmute(Ptr8(ptr));
145+ | ^^^^^^^^^^^^^^^^^^^^
146+ |
147+ help: use an `as` cast instead
148+ |
149+ LL - let _: *const i8 = transmute(Ptr8(ptr));
150+ LL + let _: *const i8 = Ptr8(ptr).0 as *const i8;
151+ |
152+
153+ error: transmute from a pointer to a pointer
154+ --> tests/ui/transmute_ptr_to_ptr.rs:118:28
107155 |
108156LL | let _: *const i8 = transmute(ptr);
109157 | ^^^^^^^^^^^^^^
@@ -115,7 +163,7 @@ LL + let _: *const i8 = ptr.cast::<i8>();
115163 |
116164
117165error: transmute from a pointer to a pointer
118- --> tests/ui/transmute_ptr_to_ptr.rs:103 :26
166+ --> tests/ui/transmute_ptr_to_ptr.rs:126 :26
119167 |
120168LL | let _: *mut u8 = transmute(ptr);
121169 | ^^^^^^^^^^^^^^
@@ -127,7 +175,7 @@ LL + let _: *mut u8 = ptr as *mut u8;
127175 |
128176
129177error: transmute from a pointer to a pointer
130- --> tests/ui/transmute_ptr_to_ptr.rs:105 :28
178+ --> tests/ui/transmute_ptr_to_ptr.rs:128 :28
131179 |
132180LL | let _: *const u8 = transmute(mut_ptr);
133181 | ^^^^^^^^^^^^^^^^^^
@@ -139,7 +187,7 @@ LL + let _: *const u8 = mut_ptr as *const u8;
139187 |
140188
141189error: transmute from a pointer to a pointer
142- --> tests/ui/transmute_ptr_to_ptr.rs:113 :26
190+ --> tests/ui/transmute_ptr_to_ptr.rs:136 :26
143191 |
144192LL | let _: *mut u8 = transmute(ptr);
145193 | ^^^^^^^^^^^^^^
@@ -151,7 +199,7 @@ LL + let _: *mut u8 = ptr.cast_mut();
151199 |
152200
153201error: transmute from a pointer to a pointer
154- --> tests/ui/transmute_ptr_to_ptr.rs:115 :28
202+ --> tests/ui/transmute_ptr_to_ptr.rs:138 :28
155203 |
156204LL | let _: *const u8 = transmute(mut_ptr);
157205 | ^^^^^^^^^^^^^^^^^^
@@ -162,5 +210,5 @@ LL - let _: *const u8 = transmute(mut_ptr);
162210LL + let _: *const u8 = mut_ptr.cast_const();
163211 |
164212
165- error: aborting due to 16 previous errors
213+ error: aborting due to 20 previous errors
166214
0 commit comments