summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/infer/uninferred-consts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/infer/uninferred-consts.rs')
-rw-r--r--src/test/ui/const-generics/infer/uninferred-consts.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/infer/uninferred-consts.rs b/src/test/ui/const-generics/infer/uninferred-consts.rs
new file mode 100644
index 000000000..657f4b513
--- /dev/null
+++ b/src/test/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
+}