We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
const_for
1 parent dbd1269 commit 3c6678aCopy full SHA for 3c6678a
src/test/ui/consts/const-for.rs
@@ -0,0 +1,10 @@
1
+#![feature(const_for)]
2
+#![feature(const_mut_refs)]
3
+
4
+const _: () = {
5
+ for _ in 0..5 {}
6
+ //~^ error: calls in constants are limited to
7
+ //~| error: calls in constants are limited to
8
+};
9
10
+fn main() {}
src/test/ui/consts/const-for.stderr
@@ -0,0 +1,15 @@
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/const-for.rs:5:14
+ |
+LL | for _ in 0..5 {}
+ | ^^^^
11
12
13
+error: aborting due to 2 previous errors
14
15
+For more information about this error, try `rustc --explain E0015`.
0 commit comments