very weird warning when using same varname for const and let binding #112269
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
This will cause rustc to interpret the
y
as aif let
binding for some reason which seems quite surprising.When I replace
let
bystatic
, I get a warning that seems to be much closer to reality:IMO it would make sense to issue such warning for the first case as well, instead of the if-let/range diagnostic.
The text was updated successfully, but these errors were encountered: