Closed
Description
Given:
for foo, bar in [(1, 2), (3, 4)] {}
rustc produces:
error: missing `in` in `for` loop
--> src/main.rs:44:12
|
44 | for foo, bar in [(1, 2)] {}
| ^ help: try adding `in` here
error: expected expression, found `,`
--> src/main.rs:44:12
|
44 | for foo, bar in [(1, 2)] {}
| ^
…but it would be better if it figured out that the user presumably intended for (foo, bar) in ...
, and gave a more specific error message.
This is probably a somewhat common error coming from Python, which has similar syntax for for
loops but allows omitting the parentheses.