@@ -75,7 +75,18 @@ LL | let _: *mut u32 = ptr.cast_mut();
75
75
| ~~~~~~~~~~~~~~
76
76
77
77
error: 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
79
90
|
80
91
LL | let _: *const i8 = transmute(ptr);
81
92
| ^^^^^^^^^^^^^^
@@ -86,7 +97,7 @@ LL | let _: *const i8 = ptr as *const i8;
86
97
| ~~~~~~~~~~~~~~~~
87
98
88
99
error: 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
90
101
|
91
102
LL | let _: *const i8 = transmute(ptr);
92
103
| ^^^^^^^^^^^^^^
@@ -97,7 +108,7 @@ LL | let _: *const i8 = ptr.cast::<i8>();
97
108
| ~~~~~~~~~~~~~~~~
98
109
99
110
error: 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
101
112
|
102
113
LL | let _: *mut u8 = transmute(ptr);
103
114
| ^^^^^^^^^^^^^^
@@ -108,7 +119,7 @@ LL | let _: *mut u8 = ptr as *mut u8;
108
119
| ~~~~~~~~~~~~~~
109
120
110
121
error: 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
112
123
|
113
124
LL | let _: *const u8 = transmute(mut_ptr);
114
125
| ^^^^^^^^^^^^^^^^^^
@@ -119,7 +130,7 @@ LL | let _: *const u8 = mut_ptr as *const u8;
119
130
| ~~~~~~~~~~~~~~~~~~~~
120
131
121
132
error: 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
123
134
|
124
135
LL | let _: *mut u8 = transmute(ptr);
125
136
| ^^^^^^^^^^^^^^
@@ -130,7 +141,7 @@ LL | let _: *mut u8 = ptr.cast_mut();
130
141
| ~~~~~~~~~~~~~~
131
142
132
143
error: 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
134
145
|
135
146
LL | let _: *const u8 = transmute(mut_ptr);
136
147
| ^^^^^^^^^^^^^^^^^^
@@ -140,5 +151,5 @@ help: use `pointer::cast_const` instead
140
151
LL | let _: *const u8 = mut_ptr.cast_const();
141
152
| ~~~~~~~~~~~~~~~~~~~~
142
153
143
- error: aborting due to 15 previous errors
154
+ error: aborting due to 16 previous errors
144
155
0 commit comments