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