Add const_for
test
This commit is contained in:
parent
dbd126901a
commit
3c6678a968
2 changed files with 25 additions and 0 deletions
10
src/test/ui/consts/const-for.rs
Normal file
10
src/test/ui/consts/const-for.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
#![feature(const_for)]
|
||||
#![feature(const_mut_refs)]
|
||||
|
||||
const _: () = {
|
||||
for _ in 0..5 {}
|
||||
//~^ error: calls in constants are limited to
|
||||
//~| error: calls in constants are limited to
|
||||
};
|
||||
|
||||
fn main() {}
|
15
src/test/ui/consts/const-for.stderr
Normal file
15
src/test/ui/consts/const-for.stderr
Normal file
|
@ -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 {}
|
||||
| ^^^^
|
||||
|
||||
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 {}
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
Loading…
Reference in a new issue