rust/tests/ui/missing/missing-items/missing-const-parameter.rs
León Orell Valerian Liehr f2acafe9e2 suggest adding const param
2023-04-07 09:11:53 +02:00

25 lines
732 B
Rust

struct Struct<const N: usize>;
impl Struct<{ N }> {}
//~^ ERROR cannot find value `N` in this scope
//~| HELP you might be missing a const parameter
fn func0(_: Struct<{ N }>) {}
//~^ ERROR cannot find value `N` in this scope
//~| HELP you might be missing a const parameter
fn func1(_: [u8; N]) {}
//~^ ERROR cannot find value `N` in this scope
//~| HELP you might be missing a const parameter
fn func2<T>(_: [T; N]) {}
//~^ ERROR cannot find value `N` in this scope
//~| HELP you might be missing a const parameter
struct Image<const R: usize>([[u32; C]; R]);
//~^ ERROR cannot find value `C` in this scope
//~| HELP a const parameter with a similar name exists
//~| HELP you might be missing a const parameter
fn main() {}