-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
emit lint when using ref with match ergonomics #105773
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
because of match ergonomics, every binding inside of
Someis already matched byrefimplicitly, so the additional explicitrefis completely redundant. Consider the following example wherelandrhave the exact same type.This lint should either suggest to disable match ergonomics by adding
&and&mutpatterns in the relevant places or to remove theref.There are a lot of places even inside of rustc which hit this pattern, so this lint feels really desirable to me.