unused_parens
false positive for parenthesised Range
in for
loop
#90807
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: playground stable / nightly
The current output is:
No warnings should be generated as removing the parentheses around the
Range
expression changes the meaning of the code (to a compiler error):The suggested code is parsed as a
RangeFrom
and{ 2 }
as thefor
loop’s block, followed by en empty block:playground
rustc
versionsThe text was updated successfully, but these errors were encountered: