Add ui test for missing expression in for loop
This commit is contained in:
parent
7a75278836
commit
17b6bd6b70
5
tests/ui/parser/missing-expression-in-for-loop.rs
Normal file
5
tests/ui/parser/missing-expression-in-for-loop.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
fn main() {
|
||||||
|
for i in {
|
||||||
|
//~^ ERROR missing expression to iterate on in `for` loop
|
||||||
|
}
|
||||||
|
}
|
13
tests/ui/parser/missing-expression-in-for-loop.stderr
Normal file
13
tests/ui/parser/missing-expression-in-for-loop.stderr
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
error: missing expression to iterate on in `for` loop
|
||||||
|
--> $DIR/missing-expression-in-for-loop.rs:2:14
|
||||||
|
|
|
||||||
|
LL | for i in {
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
help: try adding an expression to the `for` loop
|
||||||
|
|
|
||||||
|
LL | for i in /* expression */ {
|
||||||
|
| ++++++++++++++++
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
Loading…
Reference in New Issue
Block a user