-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
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.
leonardo-mscottmcm
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints