confusing error message in for-loop with duplicate in
#52964
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
in
#52964
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: