-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
unused_variables and unused_assignments lints do not catch array usage #65467
Copy link
Copy link
Open
Labels
A-arrayArea: `[T; N]`Area: `[T; N]`A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-arrayArea: `[T; N]`Area: `[T; N]`A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
I recently had a problem where I was accidentally implicitly copying an array with
if letbindings, and the writes to the original array were never made (I needed to addrefin my bindings). I thought it was strange that there was no warnings for this, and noticed this is true for these lints in general. Here's a small reproduction (also on the playground).I would expect these lints to fire here, is this expected behavior? I tried a quick search and wasn't able to find an existing issue.