@@ -190,95 +190,57 @@ error: transmute from a `i32` to a `f32`
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
- error: transmute from a `f32` to a `u32`
194
- --> $DIR/transmute.rs:131:27
195
- |
196
- LL | let _: u32 = unsafe { std::mem::transmute(1f32) };
197
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits()`
198
- |
199
- = note: `-D clippy::transmute-float-to-int` implied by `-D warnings`
200
-
201
- error: transmute from a `f32` to a `i32`
202
- --> $DIR/transmute.rs:132:27
203
- |
204
- LL | let _: i32 = unsafe { std::mem::transmute(1f32) };
205
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f32.to_bits() as i32`
206
-
207
- error: transmute from a `f64` to a `u64`
208
- --> $DIR/transmute.rs:133:27
209
- |
210
- LL | let _: u64 = unsafe { std::mem::transmute(1f64) };
211
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits()`
212
-
213
- error: transmute from a `f64` to a `i64`
214
- --> $DIR/transmute.rs:134:27
215
- |
216
- LL | let _: i64 = unsafe { std::mem::transmute(1f64) };
217
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1f64.to_bits() as i64`
218
-
219
- error: transmute from a `f64` to a `u64`
220
- --> $DIR/transmute.rs:135:27
221
- |
222
- LL | let _: u64 = unsafe { std::mem::transmute(1.0) };
223
- | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.0f64.to_bits()`
224
-
225
- error: transmute from a `f64` to a `u64`
226
- --> $DIR/transmute.rs:136:27
227
- |
228
- LL | let _: u64 = unsafe { std::mem::transmute(-1.0) };
229
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-1.0f64).to_bits()`
230
-
231
193
error: transmute from a `&[u8]` to a `&str`
232
- --> $DIR/transmute.rs:140 :28
194
+ --> $DIR/transmute.rs:130 :28
233
195
|
234
196
LL | let _: &str = unsafe { std::mem::transmute(b) };
235
197
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
236
198
|
237
199
= note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
238
200
239
201
error: transmute from a `&mut [u8]` to a `&mut str`
240
- --> $DIR/transmute.rs:141 :32
202
+ --> $DIR/transmute.rs:131 :32
241
203
|
242
204
LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
243
205
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
244
206
245
207
error: transmute from a pointer to a pointer
246
- --> $DIR/transmute.rs:173 :29
208
+ --> $DIR/transmute.rs:163 :29
247
209
|
248
210
LL | let _: *const f32 = std::mem::transmute(ptr);
249
211
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
250
212
|
251
213
= note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
252
214
253
215
error: transmute from a pointer to a pointer
254
- --> $DIR/transmute.rs:174 :27
216
+ --> $DIR/transmute.rs:164 :27
255
217
|
256
218
LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
257
219
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
258
220
259
221
error: transmute from a reference to a reference
260
- --> $DIR/transmute.rs:176 :23
222
+ --> $DIR/transmute.rs:166 :23
261
223
|
262
224
LL | let _: &f32 = std::mem::transmute(&1u32);
263
225
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
264
226
265
227
error: transmute from a reference to a reference
266
- --> $DIR/transmute.rs:177 :23
228
+ --> $DIR/transmute.rs:167 :23
267
229
|
268
230
LL | let _: &f64 = std::mem::transmute(&1f32);
269
231
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
270
232
271
233
error: transmute from a reference to a reference
272
- --> $DIR/transmute.rs:180 :27
234
+ --> $DIR/transmute.rs:170 :27
273
235
|
274
236
LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
275
237
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
276
238
277
239
error: transmute from a reference to a reference
278
- --> $DIR/transmute.rs:181 :37
240
+ --> $DIR/transmute.rs:171 :37
279
241
|
280
242
LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
281
243
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
282
244
283
- error: aborting due to 44 previous errors
245
+ error: aborting due to 38 previous errors
284
246
0 commit comments