@@ -190,95 +190,57 @@ 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-
231193error: transmute from a `&[u8]` to a `&str`
232- --> $DIR/transmute.rs:140 :28
194+ --> $DIR/transmute.rs:130 :28
233195 |
234196LL | let _: &str = unsafe { std::mem::transmute(b) };
235197 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
236198 |
237199 = note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
238200
239201error: transmute from a `&mut [u8]` to a `&mut str`
240- --> $DIR/transmute.rs:141 :32
202+ --> $DIR/transmute.rs:131 :32
241203 |
242204LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
243205 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
244206
245207error: transmute from a pointer to a pointer
246- --> $DIR/transmute.rs:173 :29
208+ --> $DIR/transmute.rs:163 :29
247209 |
248210LL | let _: *const f32 = std::mem::transmute(ptr);
249211 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr as *const f32`
250212 |
251213 = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
252214
253215error: transmute from a pointer to a pointer
254- --> $DIR/transmute.rs:174 :27
216+ --> $DIR/transmute.rs:164 :27
255217 |
256218LL | let _: *mut f32 = std::mem::transmute(mut_ptr);
257219 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mut_ptr as *mut f32`
258220
259221error: transmute from a reference to a reference
260- --> $DIR/transmute.rs:176 :23
222+ --> $DIR/transmute.rs:166 :23
261223 |
262224LL | let _: &f32 = std::mem::transmute(&1u32);
263225 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1u32 as *const u32 as *const f32)`
264226
265227error: transmute from a reference to a reference
266- --> $DIR/transmute.rs:177 :23
228+ --> $DIR/transmute.rs:167 :23
267229 |
268230LL | let _: &f64 = std::mem::transmute(&1f32);
269231 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&1f32 as *const f32 as *const f64)`
270232
271233error: transmute from a reference to a reference
272- --> $DIR/transmute.rs:180 :27
234+ --> $DIR/transmute.rs:170 :27
273235 |
274236LL | let _: &mut f32 = std::mem::transmute(&mut 1u32);
275237 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *(&mut 1u32 as *mut u32 as *mut f32)`
276238
277239error: transmute from a reference to a reference
278- --> $DIR/transmute.rs:181 :37
240+ --> $DIR/transmute.rs:171 :37
279241 |
280242LL | let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
281243 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(&GenericParam { t: 1u32 } as *const GenericParam<u32> as *const GenericParam<f32>)`
282244
283- error: aborting due to 44 previous errors
245+ error: aborting due to 38 previous errors
284246
0 commit comments