@@ -154,82 +154,108 @@ LL |         let y: char = transmute(y);
154154   = help: consider `char::from_u32(…).unwrap()`
155155
156156error: unnecessary transmute
157-   --> $DIR/unnecessary-transmutation.rs:53:22
157+   --> $DIR/unnecessary-transmutation.rs:52:22
158+    |
159+ LL |         let y: i32 = transmute('🐱');
160+    |                      ^^^^^^^^^^^^^^^ help: replace this with: `u32::from('🐱').cast_signed()`
161+ 
162+ error: unnecessary transmute
163+   --> $DIR/unnecessary-transmutation.rs:54:23
164+    |
165+ LL |         let y: char = transmute(y);
166+    |                       ^^^^^^^^^^^^ help: replace this with: `char::from_u32_unchecked(i32::cast_unsigned(y))`
167+    |
168+    = help: consider `char::from_u32(i32::cast_unsigned(…)).unwrap()`
169+ 
170+ error: unnecessary transmute
171+   --> $DIR/unnecessary-transmutation.rs:57:22
158172   |
159173LL |         let x: u16 = transmute(8i16);
160174   |                      ^^^^^^^^^^^^^^^ help: replace this with: `i16::cast_unsigned(8i16)`
161175
162176error: unnecessary transmute
163-   --> $DIR/unnecessary-transmutation.rs:55 :22
177+   --> $DIR/unnecessary-transmutation.rs:59 :22
164178   |
165179LL |         let x: i16 = transmute(x);
166180   |                      ^^^^^^^^^^^^ help: replace this with: `u16::cast_signed(x)`
167181
168182error: unnecessary transmute
169-   --> $DIR/unnecessary-transmutation.rs:57 :22
183+   --> $DIR/unnecessary-transmutation.rs:61 :22
170184   |
171185LL |         let x: u32 = transmute(4i32);
172186   |                      ^^^^^^^^^^^^^^^ help: replace this with: `i32::cast_unsigned(4i32)`
173187
174188error: unnecessary transmute
175-   --> $DIR/unnecessary-transmutation.rs:59 :22
189+   --> $DIR/unnecessary-transmutation.rs:63 :22
176190   |
177191LL |         let x: i32 = transmute(x);
178192   |                      ^^^^^^^^^^^^ help: replace this with: `u32::cast_signed(x)`
179193
180194error: unnecessary transmute
181-   --> $DIR/unnecessary-transmutation.rs:61 :22
195+   --> $DIR/unnecessary-transmutation.rs:65 :22
182196   |
183197LL |         let x: u64 = transmute(7i64);
184198   |                      ^^^^^^^^^^^^^^^ help: replace this with: `i64::cast_unsigned(7i64)`
185199
186200error: unnecessary transmute
187-   --> $DIR/unnecessary-transmutation.rs:63 :22
201+   --> $DIR/unnecessary-transmutation.rs:67 :22
188202   |
189203LL |         let x: i64 = transmute(x);
190204   |                      ^^^^^^^^^^^^ help: replace this with: `u64::cast_signed(x)`
191205
192206error: unnecessary transmute
193-   --> $DIR/unnecessary-transmutation.rs:66 :22
207+   --> $DIR/unnecessary-transmutation.rs:70 :22
194208   |
195209LL |         let y: f32 = transmute(1u32);
196210   |                      ^^^^^^^^^^^^^^^ help: replace this with: `f32::from_bits(1u32)`
197211
198212error: unnecessary transmute
199-   --> $DIR/unnecessary-transmutation.rs:68 :22
213+   --> $DIR/unnecessary-transmutation.rs:72 :22
200214   |
201215LL |         let y: u32 = transmute(y);
202216   |                      ^^^^^^^^^^^^ help: replace this with: `f32::to_bits(y)`
203217
204218error: unnecessary transmute
205-   --> $DIR/unnecessary-transmutation.rs:70 :22
219+   --> $DIR/unnecessary-transmutation.rs:74 :22
206220   |
207221LL |         let y: f64 = transmute(3u64);
208222   |                      ^^^^^^^^^^^^^^^ help: replace this with: `f64::from_bits(3u64)`
209223
210224error: unnecessary transmute
211-   --> $DIR/unnecessary-transmutation.rs:72 :22
225+   --> $DIR/unnecessary-transmutation.rs:76 :22
212226   |
213227LL |         let y: u64 = transmute(2.0);
214228   |                      ^^^^^^^^^^^^^^ help: replace this with: `f64::to_bits(2.0)`
215229
216230error: unnecessary transmute
217-   --> $DIR/unnecessary-transmutation.rs:75:23
231+   --> $DIR/unnecessary-transmutation.rs:79:22
232+    |
233+ LL |         let y: f64 = transmute(1i64);
234+    |                      ^^^^^^^^^^^^^^^ help: replace this with: `f64::from_bits(i64::cast_unsigned(1i64))`
235+ 
236+ error: unnecessary transmute
237+   --> $DIR/unnecessary-transmutation.rs:81:22
238+    |
239+ LL |         let y: i64 = transmute(1f64);
240+    |                      ^^^^^^^^^^^^^^^ help: replace this with: `f64::to_bits(1f64).cast_signed()`
241+ 
242+ error: unnecessary transmute
243+   --> $DIR/unnecessary-transmutation.rs:84:23
218244   |
219245LL |         let z: bool = transmute(1u8);
220246   |                       ^^^^^^^^^^^^^^ help: replace this with: `(1u8 == 1)`
221247
222248error: unnecessary transmute
223-   --> $DIR/unnecessary-transmutation.rs:77 :21
249+   --> $DIR/unnecessary-transmutation.rs:86 :21
224250   |
225251LL |         let z: u8 = transmute(z);
226252   |                     ^^^^^^^^^^^^ help: replace this with: `(z) as u8`
227253
228254error: unnecessary transmute
229-   --> $DIR/unnecessary-transmutation.rs:82 :21
255+   --> $DIR/unnecessary-transmutation.rs:91 :21
230256   |
231257LL |         let z: i8 = transmute(z);
232258   |                     ^^^^^^^^^^^^ help: replace this with: `(z) as i8`
233259
234- error: aborting due to 32  previous errors
260+ error: aborting due to 36  previous errors
235261
0 commit comments