Add Default Lint to Ensure Match Arm Bindings do not Shadow Local Variables. #68433
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
we currently emit:
However, in this case, the developer was likely confused and thought they were matching on the value of
c
, not creating a binding of with namec
. We should emit something more similar to:The text was updated successfully, but these errors were encountered: