diff options
Diffstat (limited to 'tests/ui/missing/missing-items/missing-const-parameter.rs')
-rw-r--r-- | tests/ui/missing/missing-items/missing-const-parameter.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/missing/missing-items/missing-const-parameter.rs b/tests/ui/missing/missing-items/missing-const-parameter.rs new file mode 100644 index 000000000..a3af88f26 --- /dev/null +++ b/tests/ui/missing/missing-items/missing-const-parameter.rs @@ -0,0 +1,24 @@ +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() {} |