about summary refs log tree commit diff
path: root/tests/ui/const-generics/infer/one-param-uninferred.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/infer/one-param-uninferred.rs')
-rw-r--r--tests/ui/const-generics/infer/one-param-uninferred.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/const-generics/infer/one-param-uninferred.rs b/tests/ui/const-generics/infer/one-param-uninferred.rs
new file mode 100644
index 00000000000..d6018650f53
--- /dev/null
+++ b/tests/ui/const-generics/infer/one-param-uninferred.rs
@@ -0,0 +1,11 @@
+// Test that we emit an error if we cannot properly infer a constant.
+fn foo<const N: usize, const M: usize>() -> [u8; N] {
+    todo!()
+}
+
+fn main() {
+    // FIXME(const_generics): Currently this only suggests one const parameter,
+    // but instead it should suggest to provide all parameters.
+    let _: [u8; 17] = foo();
+                  //~^ ERROR type annotations needed
+}