]> git.lizzy.rs Git - rust.git/blob - src/test/ui/numeric/len.stderr
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / numeric / len.stderr
1 error[E0308]: mismatched types
2   --> $DIR/len.rs:3:10
3    |
4 LL |     test(array.len());
5    |     ---- ^^^^^^^^^^^ expected `u32`, found `usize`
6    |     |
7    |     arguments to this function are incorrect
8    |
9 note: function defined here
10   --> $DIR/len.rs:6:4
11    |
12 LL | fn test(length: u32) {
13    |    ^^^^ -----------
14 help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
15    |
16 LL |     test(array.len().try_into().unwrap());
17    |                     ++++++++++++++++++++
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0308`.