fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.1 KiB32 linesraw
1error[E0308]: mismatched types
2  --> $DIR/tutorial-suffix-inference-test.rs:9:18
3   |
4LL |     identity_u16(x);
5   |                  ^
6   |                  |
7   |                  expected u16, found u8
8   |                  help: you can convert an `u8` to `u16`: `x.into()`
9
10error[E0308]: mismatched types
11  --> $DIR/tutorial-suffix-inference-test.rs:12:18
12   |
13LL |     identity_u16(y);
14   |                  ^ expected u16, found i32
15help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit
16   |
17LL |     identity_u16(y.try_into().unwrap());
18   |                  ^^^^^^^^^^^^^^^^^^^^^
19
20error[E0308]: mismatched types
21  --> $DIR/tutorial-suffix-inference-test.rs:21:18
22   |
23LL |     identity_u16(a);
24   |                  ^ expected u16, found isize
25help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit
26   |
27LL |     identity_u16(a.try_into().unwrap());
28   |                  ^^^^^^^^^^^^^^^^^^^^^
29
30error: aborting due to 3 previous errors
31
32For more information about this error, try `rustc --explain E0308`.