@@ -141,12 +141,10 @@ error[E0308]: mismatched types
141
141
--> $DIR/numeric-cast.rs:52:18
142
142
|
143
143
LL | 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()`
150
148
151
149
error[E0308]: mismatched types
152
150
--> $DIR/numeric-cast.rs:55:18
@@ -307,34 +305,28 @@ error[E0308]: mismatched types
307
305
--> $DIR/numeric-cast.rs:92:16
308
306
|
309
307
LL | 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()`
316
312
317
313
error[E0308]: mismatched types
318
314
--> $DIR/numeric-cast.rs:94:16
319
315
|
320
316
LL | 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()`
327
321
328
322
error[E0308]: mismatched types
329
323
--> $DIR/numeric-cast.rs:96:16
330
324
|
331
325
LL | 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()`
338
330
339
331
error[E0308]: mismatched types
340
332
--> $DIR/numeric-cast.rs:98:16
@@ -506,23 +498,19 @@ error[E0308]: mismatched types
506
498
--> $DIR/numeric-cast.rs:138:16
507
499
|
508
500
LL | 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()`
515
505
516
506
error[E0308]: mismatched types
517
507
--> $DIR/numeric-cast.rs:140:16
518
508
|
519
509
LL | 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()`
526
514
527
515
error[E0308]: mismatched types
528
516
--> $DIR/numeric-cast.rs:142:16
@@ -709,12 +697,10 @@ error[E0308]: mismatched types
709
697
--> $DIR/numeric-cast.rs:184:16
710
698
|
711
699
LL | 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()`
718
704
719
705
error[E0308]: mismatched types
720
706
--> $DIR/numeric-cast.rs:186:16
0 commit comments