@@ -190,57 +190,95 @@ error: transmute from a `i32` to a `f32`
190190LL | let _: f32 = unsafe { std::mem::transmute(0_i32) };
191191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)`
192192
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+
193231error: transmute from a `&[u8]` to a `&str`
194- --> $DIR/transmute.rs:130 :28
232+ --> $DIR/transmute.rs:140 :28
195233 |
196234LL | let _: &str = unsafe { std::mem::transmute(b) };
197235 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
198236 |
199237 = note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
200238
201239error: transmute from a `&mut [u8]` to a `&mut str`
202- --> $DIR/transmute.rs:131 :32
240+ --> $DIR/transmute.rs:141 :32
203241 |
204242LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
205243 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
206244
207245error: transmute from a pointer to a pointer
208- --> $DIR/transmute.rs:163 :29
246+ --> $DIR/transmute.rs:173 :29
209247 |
210248LL | let _: *const f32 = std::mem::transmute(ptr);
211249 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
212250 |
213251 = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
214252
215253error: transmute from a pointer to a pointer
216- --> $DIR/transmute.rs:164 :27
254+ --> $DIR/transmute.rs:174 :27
217255 |
218256LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
219257 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
220258
221259error: transmute from a reference to a reference
222- --> $DIR/transmute.rs:166 :23
260+ --> $DIR/transmute.rs:176 :23
223261 |
224262LL | let _: &f32 = std::mem::transmute(&1u32);
225263 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
226264
227265error: transmute from a reference to a reference
228- --> $DIR/transmute.rs:167 :23
266+ --> $DIR/transmute.rs:177 :23
229267 |
230268LL | let _: &f64 = std::mem::transmute(&1f32);
231269 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
232270
233271error: transmute from a reference to a reference
234- --> $DIR/transmute.rs:170 :27
272+ --> $DIR/transmute.rs:180 :27
235273 |
236274LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
237275 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
238276
239277error: transmute from a reference to a reference
240- --> $DIR/transmute.rs:171 :37
278+ --> $DIR/transmute.rs:181 :37
241279 |
242280LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
243281 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
244282
245- error: aborting due to 38 previous errors
283+ error: aborting due to 44 previous errors
246284
0 commit comments