@@ -117,127 +117,127 @@ LL | let _: Vec<i32> = my_transmute(my_vec());
117
117
| ^^^^^^^^^^^^^^^^^^^^^^
118
118
119
119
error: transmute from an integer to a pointer
120
- --> $DIR/transmute.rs:89 :31
120
+ --> $DIR/transmute.rs:83 :31
121
121
|
122
122
LL | let _: *const usize = std::mem::transmute(5_isize);
123
123
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `5_isize as *const usize`
124
124
125
125
error: transmute from an integer to a pointer
126
- --> $DIR/transmute.rs:93 :31
126
+ --> $DIR/transmute.rs:87 :31
127
127
|
128
128
LL | let _: *const usize = std::mem::transmute(1 + 1usize);
129
129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1 + 1usize) as *const usize`
130
130
131
131
error: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
132
- --> $DIR/transmute.rs:108 :24
132
+ --> $DIR/transmute.rs:102 :24
133
133
|
134
134
LL | let _: Usize = core::intrinsics::transmute(int_const_ptr);
135
135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136
136
|
137
137
= note: `-D clippy::crosspointer-transmute` implied by `-D warnings`
138
138
139
139
error: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
140
- --> $DIR/transmute.rs:110 :24
140
+ --> $DIR/transmute.rs:104 :24
141
141
|
142
142
LL | let _: Usize = core::intrinsics::transmute(int_mut_ptr);
143
143
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144
144
145
145
error: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
146
- --> $DIR/transmute.rs:112 :31
146
+ --> $DIR/transmute.rs:106 :31
147
147
|
148
148
LL | let _: *const Usize = core::intrinsics::transmute(my_int());
149
149
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150
150
151
151
error: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
152
- --> $DIR/transmute.rs:114 :29
152
+ --> $DIR/transmute.rs:108 :29
153
153
|
154
154
LL | let _: *mut Usize = core::intrinsics::transmute(my_int());
155
155
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156
156
157
157
error: transmute from a `u32` to a `char`
158
- --> $DIR/transmute.rs:120 :28
158
+ --> $DIR/transmute.rs:114 :28
159
159
|
160
160
LL | let _: char = unsafe { std::mem::transmute(0_u32) };
161
161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_u32).unwrap()`
162
162
|
163
163
= note: `-D clippy::transmute-int-to-char` implied by `-D warnings`
164
164
165
165
error: transmute from a `i32` to a `char`
166
- --> $DIR/transmute.rs:121 :28
166
+ --> $DIR/transmute.rs:115 :28
167
167
|
168
168
LL | let _: char = unsafe { std::mem::transmute(0_i32) };
169
169
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_i32 as u32).unwrap()`
170
170
171
171
error: transmute from a `u8` to a `bool`
172
- --> $DIR/transmute.rs:126 :28
172
+ --> $DIR/transmute.rs:120 :28
173
173
|
174
174
LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
175
175
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
176
176
|
177
177
= note: `-D clippy::transmute-int-to-bool` implied by `-D warnings`
178
178
179
179
error: transmute from a `u32` to a `f32`
180
- --> $DIR/transmute.rs:131 :27
180
+ --> $DIR/transmute.rs:125 :27
181
181
|
182
182
LL | let _: f32 = unsafe { std::mem::transmute(0_u32) };
183
183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)`
184
184
|
185
185
= note: `-D clippy::transmute-int-to-float` implied by `-D warnings`
186
186
187
187
error: transmute from a `i32` to a `f32`
188
- --> $DIR/transmute.rs:132 :27
188
+ --> $DIR/transmute.rs:126 :27
189
189
|
190
190
LL | let _: f32 = unsafe { std::mem::transmute(0_i32) };
191
191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)`
192
192
193
193
error: transmute from a `&[u8]` to a `&str`
194
- --> $DIR/transmute.rs:136 :28
194
+ --> $DIR/transmute.rs:130 :28
195
195
|
196
196
LL | let _: &str = unsafe { std::mem::transmute(b) };
197
197
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
198
198
|
199
199
= note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
200
200
201
201
error: transmute from a `&mut [u8]` to a `&mut str`
202
- --> $DIR/transmute.rs:137 :32
202
+ --> $DIR/transmute.rs:131 :32
203
203
|
204
204
LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
205
205
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
206
206
207
207
error: transmute from a pointer to a pointer
208
- --> $DIR/transmute.rs:169 :29
208
+ --> $DIR/transmute.rs:163 :29
209
209
|
210
210
LL | let _: *const f32 = std::mem::transmute(ptr);
211
211
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
212
212
|
213
213
= note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
214
214
215
215
error: transmute from a pointer to a pointer
216
- --> $DIR/transmute.rs:170 :27
216
+ --> $DIR/transmute.rs:164 :27
217
217
|
218
218
LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
219
219
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
220
220
221
221
error: transmute from a reference to a reference
222
- --> $DIR/transmute.rs:172 :23
222
+ --> $DIR/transmute.rs:166 :23
223
223
|
224
224
LL | let _: &f32 = std::mem::transmute(&1u32);
225
225
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
226
226
227
227
error: transmute from a reference to a reference
228
- --> $DIR/transmute.rs:173 :23
228
+ --> $DIR/transmute.rs:167 :23
229
229
|
230
230
LL | let _: &f64 = std::mem::transmute(&1f32);
231
231
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
232
232
233
233
error: transmute from a reference to a reference
234
- --> $DIR/transmute.rs:176 :27
234
+ --> $DIR/transmute.rs:170 :27
235
235
|
236
236
LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
237
237
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
238
238
239
239
error: transmute from a reference to a reference
240
- --> $DIR/transmute.rs:177 :37
240
+ --> $DIR/transmute.rs:171 :37
241
241
|
242
242
LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
243
243
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
0 commit comments