1 error[E0308]: mismatched types
2 --> $DIR/numeric-cast-2.rs:5:18
4 LL | let x: u16 = foo();
5 | --- ^^^^^ expected `u16`, found `i32`
9 help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit
11 LL | let x: u16 = foo().try_into().unwrap();
12 | ^^^^^^^^^^^^^^^^^^^^^^^^^
14 error[E0308]: mismatched types
15 --> $DIR/numeric-cast-2.rs:7:18
17 LL | let y: i64 = x + x;
18 | --- ^^^^^ expected `i64`, found `u16`
20 | expected due to this
22 help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
24 LL | let y: i64 = (x + x).try_into().unwrap();
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 error[E0308]: mismatched types
28 --> $DIR/numeric-cast-2.rs:9:18
30 LL | let z: i32 = x + x;
31 | --- ^^^^^ expected `i32`, found `u16`
33 | expected due to this
35 help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
37 LL | let z: i32 = (x + x).try_into().unwrap();
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 error: aborting due to 3 previous errors
42 For more information about this error, try `rustc --explain E0308`.