]> git.lizzy.rs Git - rust.git/blob - src/test/ui/numeric/numeric-cast-2.stderr
Auto merge of #81507 - weiznich:add_diesel_to_cargo_test, r=Mark-Simulacrum
[rust.git] / src / test / ui / numeric / numeric-cast-2.stderr
1 error[E0308]: mismatched types
2   --> $DIR/numeric-cast-2.rs:5:18
3    |
4 LL |     let x: u16 = foo();
5    |            ---   ^^^^^ expected `u16`, found `i32`
6    |            |
7    |            expected due to this
8    |
9 help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
10    |
11 LL |     let x: u16 = foo().try_into().unwrap();
12    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
13
14 error[E0308]: mismatched types
15   --> $DIR/numeric-cast-2.rs:7:18
16    |
17 LL |     let y: i64 = x + x;
18    |            ---   ^^^^^
19    |            |     |
20    |            |     expected `i64`, found `u16`
21    |            |     help: you can convert a `u16` to an `i64`: `(x + x).into()`
22    |            expected due to this
23
24 error[E0308]: mismatched types
25   --> $DIR/numeric-cast-2.rs:9:18
26    |
27 LL |     let z: i32 = x + x;
28    |            ---   ^^^^^
29    |            |     |
30    |            |     expected `i32`, found `u16`
31    |            |     help: you can convert a `u16` to an `i32`: `(x + x).into()`
32    |            expected due to this
33
34 error: aborting due to 3 previous errors
35
36 For more information about this error, try `rustc --explain E0308`.