@@ -154,82 +154,108 @@ LL | let y: char = transmute(y);
154
154
= help: consider `char::from_u32(…).unwrap()`
155
155
156
156
error: 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
158
172
|
159
173
LL | let x: u16 = transmute(8i16);
160
174
| ^^^^^^^^^^^^^^^ help: replace this with: `i16::cast_unsigned(8i16)`
161
175
162
176
error: unnecessary transmute
163
- --> $DIR/unnecessary-transmutation.rs:55 :22
177
+ --> $DIR/unnecessary-transmutation.rs:59 :22
164
178
|
165
179
LL | let x: i16 = transmute(x);
166
180
| ^^^^^^^^^^^^ help: replace this with: `u16::cast_signed(x)`
167
181
168
182
error: unnecessary transmute
169
- --> $DIR/unnecessary-transmutation.rs:57 :22
183
+ --> $DIR/unnecessary-transmutation.rs:61 :22
170
184
|
171
185
LL | let x: u32 = transmute(4i32);
172
186
| ^^^^^^^^^^^^^^^ help: replace this with: `i32::cast_unsigned(4i32)`
173
187
174
188
error: unnecessary transmute
175
- --> $DIR/unnecessary-transmutation.rs:59 :22
189
+ --> $DIR/unnecessary-transmutation.rs:63 :22
176
190
|
177
191
LL | let x: i32 = transmute(x);
178
192
| ^^^^^^^^^^^^ help: replace this with: `u32::cast_signed(x)`
179
193
180
194
error: unnecessary transmute
181
- --> $DIR/unnecessary-transmutation.rs:61 :22
195
+ --> $DIR/unnecessary-transmutation.rs:65 :22
182
196
|
183
197
LL | let x: u64 = transmute(7i64);
184
198
| ^^^^^^^^^^^^^^^ help: replace this with: `i64::cast_unsigned(7i64)`
185
199
186
200
error: unnecessary transmute
187
- --> $DIR/unnecessary-transmutation.rs:63 :22
201
+ --> $DIR/unnecessary-transmutation.rs:67 :22
188
202
|
189
203
LL | let x: i64 = transmute(x);
190
204
| ^^^^^^^^^^^^ help: replace this with: `u64::cast_signed(x)`
191
205
192
206
error: unnecessary transmute
193
- --> $DIR/unnecessary-transmutation.rs:66 :22
207
+ --> $DIR/unnecessary-transmutation.rs:70 :22
194
208
|
195
209
LL | let y: f32 = transmute(1u32);
196
210
| ^^^^^^^^^^^^^^^ help: replace this with: `f32::from_bits(1u32)`
197
211
198
212
error: unnecessary transmute
199
- --> $DIR/unnecessary-transmutation.rs:68 :22
213
+ --> $DIR/unnecessary-transmutation.rs:72 :22
200
214
|
201
215
LL | let y: u32 = transmute(y);
202
216
| ^^^^^^^^^^^^ help: replace this with: `f32::to_bits(y)`
203
217
204
218
error: unnecessary transmute
205
- --> $DIR/unnecessary-transmutation.rs:70 :22
219
+ --> $DIR/unnecessary-transmutation.rs:74 :22
206
220
|
207
221
LL | let y: f64 = transmute(3u64);
208
222
| ^^^^^^^^^^^^^^^ help: replace this with: `f64::from_bits(3u64)`
209
223
210
224
error: unnecessary transmute
211
- --> $DIR/unnecessary-transmutation.rs:72 :22
225
+ --> $DIR/unnecessary-transmutation.rs:76 :22
212
226
|
213
227
LL | let y: u64 = transmute(2.0);
214
228
| ^^^^^^^^^^^^^^ help: replace this with: `f64::to_bits(2.0)`
215
229
216
230
error: 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
218
244
|
219
245
LL | let z: bool = transmute(1u8);
220
246
| ^^^^^^^^^^^^^^ help: replace this with: `(1u8 == 1)`
221
247
222
248
error: unnecessary transmute
223
- --> $DIR/unnecessary-transmutation.rs:77 :21
249
+ --> $DIR/unnecessary-transmutation.rs:86 :21
224
250
|
225
251
LL | let z: u8 = transmute(z);
226
252
| ^^^^^^^^^^^^ help: replace this with: `(z) as u8`
227
253
228
254
error: unnecessary transmute
229
- --> $DIR/unnecessary-transmutation.rs:82 :21
255
+ --> $DIR/unnecessary-transmutation.rs:91 :21
230
256
|
231
257
LL | let z: i8 = transmute(z);
232
258
| ^^^^^^^^^^^^ help: replace this with: `(z) as i8`
233
259
234
- error: aborting due to 32 previous errors
260
+ error: aborting due to 36 previous errors
235
261
0 commit comments