rust/tests/ui/const-generics/type_mismatch.rs

11 lines
241 B
Rust

fn foo<const N: usize>() -> [u8; N] {
bar::<N>() //~ ERROR mismatched types
//~^ ERROR the constant `N` is not of type `u8`
}
fn bar<const N: u8>() -> [u8; N] {}
//~^ ERROR mismatched types
//~| ERROR mismatched types
fn main() {}