about summary refs log tree commit diff
path: root/src/test/ui/const-generics/infer/one-param-uninferred.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/infer/one-param-uninferred.rs')
-rw-r--r--src/test/ui/const-generics/infer/one-param-uninferred.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.rs b/src/test/ui/const-generics/infer/one-param-uninferred.rs
new file mode 100644
index 00000000000..0e947131f4c
--- /dev/null
+++ b/src/test/ui/const-generics/infer/one-param-uninferred.rs
@@ -0,0 +1,17 @@
+// Test that we emit an error if we cannot properly infer a constant.
+// revisions: full min
+
+#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, allow(incomplete_features))]
+#![cfg_attr(min, feature(min_const_generics))]
+
+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
+}