@@ -141,12 +141,10 @@ error[E0308]: mismatched types
141141 --> $DIR/numeric-cast.rs:52:18
142142 |
143143LL | foo::<isize>(x_u8);
144- | ^^^^ expected `isize`, found `u8`
145- |
146- help: you can convert an `u8` to `isize` and panic if the converted value wouldn't fit
147- |
148- LL | foo::<isize>(x_u8.try_into().unwrap());
149- | ^^^^^^^^^^^^^^^^^^^^^^^^
144+ | ^^^^
145+ | |
146+ | expected `isize`, found `u8`
147+ | help: you can convert an `u8` to `isize`: `x_u8.into()`
150148
151149error[E0308]: mismatched types
152150 --> $DIR/numeric-cast.rs:55:18
@@ -307,34 +305,28 @@ error[E0308]: mismatched types
307305 --> $DIR/numeric-cast.rs:92:16
308306 |
309307LL | foo::<i64>(x_u32);
310- | ^^^^^ expected `i64`, found `u32`
311- |
312- help: you can convert an `u32` to `i64` and panic if the converted value wouldn't fit
313- |
314- LL | foo::<i64>(x_u32.try_into().unwrap());
315- | ^^^^^^^^^^^^^^^^^^^^^^^^^
308+ | ^^^^^
309+ | |
310+ | expected `i64`, found `u32`
311+ | help: you can convert an `u32` to `i64`: `x_u32.into()`
316312
317313error[E0308]: mismatched types
318314 --> $DIR/numeric-cast.rs:94:16
319315 |
320316LL | foo::<i64>(x_u16);
321- | ^^^^^ expected `i64`, found `u16`
322- |
323- help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
324- |
325- LL | foo::<i64>(x_u16.try_into().unwrap());
326- | ^^^^^^^^^^^^^^^^^^^^^^^^^
317+ | ^^^^^
318+ | |
319+ | expected `i64`, found `u16`
320+ | help: you can convert an `u16` to `i64`: `x_u16.into()`
327321
328322error[E0308]: mismatched types
329323 --> $DIR/numeric-cast.rs:96:16
330324 |
331325LL | foo::<i64>(x_u8);
332- | ^^^^ expected `i64`, found `u8`
333- |
334- help: you can convert an `u8` to `i64` and panic if the converted value wouldn't fit
335- |
336- LL | foo::<i64>(x_u8.try_into().unwrap());
337- | ^^^^^^^^^^^^^^^^^^^^^^^^
326+ | ^^^^
327+ | |
328+ | expected `i64`, found `u8`
329+ | help: you can convert an `u8` to `i64`: `x_u8.into()`
338330
339331error[E0308]: mismatched types
340332 --> $DIR/numeric-cast.rs:98:16
@@ -506,23 +498,19 @@ error[E0308]: mismatched types
506498 --> $DIR/numeric-cast.rs:138:16
507499 |
508500LL | foo::<i32>(x_u16);
509- | ^^^^^ expected `i32`, found `u16`
510- |
511- help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
512- |
513- LL | foo::<i32>(x_u16.try_into().unwrap());
514- | ^^^^^^^^^^^^^^^^^^^^^^^^^
501+ | ^^^^^
502+ | |
503+ | expected `i32`, found `u16`
504+ | help: you can convert an `u16` to `i32`: `x_u16.into()`
515505
516506error[E0308]: mismatched types
517507 --> $DIR/numeric-cast.rs:140:16
518508 |
519509LL | foo::<i32>(x_u8);
520- | ^^^^ expected `i32`, found `u8`
521- |
522- help: you can convert an `u8` to `i32` and panic if the converted value wouldn't fit
523- |
524- LL | foo::<i32>(x_u8.try_into().unwrap());
525- | ^^^^^^^^^^^^^^^^^^^^^^^^
510+ | ^^^^
511+ | |
512+ | expected `i32`, found `u8`
513+ | help: you can convert an `u8` to `i32`: `x_u8.into()`
526514
527515error[E0308]: mismatched types
528516 --> $DIR/numeric-cast.rs:142:16
@@ -709,12 +697,10 @@ error[E0308]: mismatched types
709697 --> $DIR/numeric-cast.rs:184:16
710698 |
711699LL | foo::<i16>(x_u8);
712- | ^^^^ expected `i16`, found `u8`
713- |
714- help: you can convert an `u8` to `i16` and panic if the converted value wouldn't fit
715- |
716- LL | foo::<i16>(x_u8.try_into().unwrap());
717- | ^^^^^^^^^^^^^^^^^^^^^^^^
700+ | ^^^^
701+ | |
702+ | expected `i16`, found `u8`
703+ | help: you can convert an `u8` to `i16`: `x_u8.into()`
718704
719705error[E0308]: mismatched types
720706 --> $DIR/numeric-cast.rs:186:16
0 commit comments