about summary refs log tree commit diff
path: root/tests/ui/const-generics/suggest_const_for_array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/suggest_const_for_array.rs')
-rw-r--r--tests/ui/const-generics/suggest_const_for_array.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/const-generics/suggest_const_for_array.rs b/tests/ui/const-generics/suggest_const_for_array.rs
new file mode 100644
index 00000000000..f3e5a3186cd
--- /dev/null
+++ b/tests/ui/const-generics/suggest_const_for_array.rs
@@ -0,0 +1,10 @@
+#![crate_type = "lib"]
+
+fn example<const N: usize>() {}
+
+fn other() {
+  example::<[usize; 3]>();
+  //~^ ERROR type provided when a const
+  example::<[usize; 4+5]>();
+  //~^ ERROR type provided when a const
+}