Skip to content

Commit

Permalink
Add ui test for missing expression in for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
obeis committed Feb 5, 2023
1 parent 7a75278 commit 17b6bd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ui/parser/missing-expression-in-for-loop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fn main() {
for i in {
//~^ ERROR missing expression to iterate on in `for` loop
}
}
13 changes: 13 additions & 0 deletions tests/ui/parser/missing-expression-in-for-loop.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 17b6bd6

Please sign in to comment.