]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/tutorial-suffix-inference-test.stderr
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / ui / inference / tutorial-suffix-inference-test.stderr
1 error[E0308]: mismatched types
2   --> $DIR/tutorial-suffix-inference-test.rs:9:18
3    |
4 LL |     identity_u16(x);
5    |     ------------ ^ expected `u16`, found `u8`
6    |     |
7    |     arguments to this function are incorrect
8    |
9 note: function defined here
10   --> $DIR/tutorial-suffix-inference-test.rs:6:8
11    |
12 LL |     fn identity_u16(n: u16) -> u16 { n }
13    |        ^^^^^^^^^^^^ ------
14 help: you can convert a `u8` to a `u16`
15    |
16 LL |     identity_u16(x.into());
17    |                   +++++++
18
19 error[E0308]: mismatched types
20   --> $DIR/tutorial-suffix-inference-test.rs:12:18
21    |
22 LL |     identity_u16(y);
23    |     ------------ ^ expected `u16`, found `i32`
24    |     |
25    |     arguments to this function are incorrect
26    |
27 note: function defined here
28   --> $DIR/tutorial-suffix-inference-test.rs:6:8
29    |
30 LL |     fn identity_u16(n: u16) -> u16 { n }
31    |        ^^^^^^^^^^^^ ------
32 help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
33    |
34 LL |     identity_u16(y.try_into().unwrap());
35    |                   ++++++++++++++++++++
36
37 error[E0308]: mismatched types
38   --> $DIR/tutorial-suffix-inference-test.rs:21:18
39    |
40 LL |     identity_u16(a);
41    |     ------------ ^ expected `u16`, found `isize`
42    |     |
43    |     arguments to this function are incorrect
44    |
45 note: function defined here
46   --> $DIR/tutorial-suffix-inference-test.rs:6:8
47    |
48 LL |     fn identity_u16(n: u16) -> u16 { n }
49    |        ^^^^^^^^^^^^ ------
50 help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
51    |
52 LL |     identity_u16(a.try_into().unwrap());
53    |                   ++++++++++++++++++++
54
55 error: aborting due to 3 previous errors
56
57 For more information about this error, try `rustc --explain E0308`.