You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accidentally writing for x in in iter with a duplicate in, the error message will point to the first thing beneath the loop body with a confusing error message.
Example:
fnmain(){let i = ();for x in in 0..1{}
i;}
results in
error: expected one of `{` or an operator, found `i`
--> src/main.rs:4:5
|
3 | for x in in 0..1 {}
| - expected one of `{` or an operator here
4 | i;
| ^ unexpected token
This is probably because in 0..1 {} is parsed as the old emplacement syntax (in PLACE { BLOCK }). And because the block has been parsed as part of the emplacement, the loop is seen as having no block.
When another block is added (for x in in 0..1 {} {}), the error message tells us that this emplacement syntax is obsolete.
The text was updated successfully, but these errors were encountered:
When accidentally writing
for x in in iter
with a duplicatein
, the error message will point to the first thing beneath the loop body with a confusing error message.Example:
results in
This is probably because
in 0..1 {}
is parsed as the old emplacement syntax (in PLACE { BLOCK }
). And because the block has been parsed as part of the emplacement, the loop is seen as having no block.When another block is added (
for x in in 0..1 {} {}
), the error message tells us that this emplacement syntax is obsolete.The text was updated successfully, but these errors were encountered: