about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/consts/issue-90878-3.rs6
-rw-r--r--src/test/ui/consts/issue-90878-3.stderr11
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-90878-3.rs b/src/test/ui/consts/issue-90878-3.rs
new file mode 100644
index 00000000000..0e36646eb49
--- /dev/null
+++ b/src/test/ui/consts/issue-90878-3.rs
@@ -0,0 +1,6 @@
+
+fn main() {
+    |x: usize| [0; x];  //~ ERROR attempt to use a non-constant value in a constant [E0435]
+    // (note the newline before "fn")
+}
+// ignore-tidy-leading-newlines
diff --git a/src/test/ui/consts/issue-90878-3.stderr b/src/test/ui/consts/issue-90878-3.stderr
new file mode 100644
index 00000000000..1bcc0eb3787
--- /dev/null
+++ b/src/test/ui/consts/issue-90878-3.stderr
@@ -0,0 +1,11 @@
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/issue-90878-3.rs:3:20
+   |
+LL |     |x: usize| [0; x];
+   |      -             ^
+   |      |
+   |      this would need to be a `const`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0435`.