@@ -75,7 +75,18 @@ LL | let _: *mut u32 = ptr.cast_mut();
7575 | ~~~~~~~~~~~~~~
7676
7777error: transmute from a pointer to a pointer
78- --> tests/ui/transmute_ptr_to_ptr.rs:74:28
78+ --> tests/ui/transmute_ptr_to_ptr.rs:64:14
79+ |
80+ LL | unsafe { transmute(v) }
81+ | ^^^^^^^^^^^^
82+ |
83+ help: use an `as` cast instead
84+ |
85+ LL | unsafe { v as *const &() }
86+ | ~~~~~~~~~~~~~~~
87+
88+ error: transmute from a pointer to a pointer
89+ --> tests/ui/transmute_ptr_to_ptr.rs:79:28
7990 |
8091LL | let _: *const i8 = transmute(ptr);
8192 | ^^^^^^^^^^^^^^
@@ -86,7 +97,7 @@ LL | let _: *const i8 = ptr as *const i8;
8697 | ~~~~~~~~~~~~~~~~
8798
8899error: transmute from a pointer to a pointer
89- --> tests/ui/transmute_ptr_to_ptr.rs:81 :28
100+ --> tests/ui/transmute_ptr_to_ptr.rs:86 :28
90101 |
91102LL | let _: *const i8 = transmute(ptr);
92103 | ^^^^^^^^^^^^^^
@@ -97,7 +108,7 @@ LL | let _: *const i8 = ptr.cast::<i8>();
97108 | ~~~~~~~~~~~~~~~~
98109
99110error: transmute from a pointer to a pointer
100- --> tests/ui/transmute_ptr_to_ptr.rs:88 :26
111+ --> tests/ui/transmute_ptr_to_ptr.rs:93 :26
101112 |
102113LL | let _: *mut u8 = transmute(ptr);
103114 | ^^^^^^^^^^^^^^
@@ -108,7 +119,7 @@ LL | let _: *mut u8 = ptr as *mut u8;
108119 | ~~~~~~~~~~~~~~
109120
110121error: transmute from a pointer to a pointer
111- --> tests/ui/transmute_ptr_to_ptr.rs:89 :28
122+ --> tests/ui/transmute_ptr_to_ptr.rs:94 :28
112123 |
113124LL | let _: *const u8 = transmute(mut_ptr);
114125 | ^^^^^^^^^^^^^^^^^^
@@ -119,7 +130,7 @@ LL | let _: *const u8 = mut_ptr as *const u8;
119130 | ~~~~~~~~~~~~~~~~~~~~
120131
121132error: transmute from a pointer to a pointer
122- --> tests/ui/transmute_ptr_to_ptr.rs:96 :26
133+ --> tests/ui/transmute_ptr_to_ptr.rs:101 :26
123134 |
124135LL | let _: *mut u8 = transmute(ptr);
125136 | ^^^^^^^^^^^^^^
@@ -130,7 +141,7 @@ LL | let _: *mut u8 = ptr.cast_mut();
130141 | ~~~~~~~~~~~~~~
131142
132143error: transmute from a pointer to a pointer
133- --> tests/ui/transmute_ptr_to_ptr.rs:97 :28
144+ --> tests/ui/transmute_ptr_to_ptr.rs:102 :28
134145 |
135146LL | let _: *const u8 = transmute(mut_ptr);
136147 | ^^^^^^^^^^^^^^^^^^
@@ -140,5 +151,5 @@ help: use `pointer::cast_const` instead
140151LL | let _: *const u8 = mut_ptr.cast_const();
141152 | ~~~~~~~~~~~~~~~~~~~~
142153
143- error: aborting due to 15 previous errors
154+ error: aborting due to 16 previous errors
144155
0 commit comments