]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/type_mismatch.stderr
Auto merge of #106825 - weihanglo:update-cargo, r=weihanglo
[rust.git] / tests / ui / const-generics / type_mismatch.stderr
1 error[E0308]: mismatched types
2   --> $DIR/type_mismatch.rs:2:11
3    |
4 LL |     bar::<N>()
5    |           ^ expected `u8`, found `usize`
6
7 error[E0308]: mismatched types
8   --> $DIR/type_mismatch.rs:5:26
9    |
10 LL | fn bar<const N: u8>() -> [u8; N] {}
11    |    ---                   ^^^^^^^ expected array `[u8; N]`, found `()`
12    |    |
13    |    implicitly returns `()` as its body has no tail or `return` expression
14
15 error[E0308]: mismatched types
16   --> $DIR/type_mismatch.rs:5:31
17    |
18 LL | fn bar<const N: u8>() -> [u8; N] {}
19    |                               ^ expected `usize`, found `u8`
20
21 error: aborting due to 3 previous errors
22
23 For more information about this error, try `rustc --explain E0308`.