diff options
Diffstat (limited to 'tests/ui/const-generics/infer/uninferred-consts.rs')
-rw-r--r-- | tests/ui/const-generics/infer/uninferred-consts.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/const-generics/infer/uninferred-consts.rs b/tests/ui/const-generics/infer/uninferred-consts.rs new file mode 100644 index 000000000..657f4b513 --- /dev/null +++ b/tests/ui/const-generics/infer/uninferred-consts.rs @@ -0,0 +1,11 @@ +// Test that we emit an error if we cannot properly infer a constant. + +// taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893 +struct Foo; +impl Foo { + fn foo<const A: usize, const B: usize>(self) {} +} +fn main() { + Foo.foo(); + //~^ ERROR type annotations needed +} |