-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
A warning about redundant imports should be separate from unused_imports #121825
Copy link
Copy link
Closed
Labels
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-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.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.
Metadata
Metadata
Assignees
Labels
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-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
There is a set of related problems:
stdand withno_std, because the prelude contents are different. In particular an unconditionaluse alloc::vec::Veccauses a warning (or error with-Dwarnings):error: the itemVecis imported redundantlyAFAIU the new warning has been introduced for issue #117448 in the changes here: #117772
This problem has been originally found in https://crbug.com/326247202. (In https://crbug.com/326247202#comment10 and https://crbug.com/326247202#comment11 we discussed disabling the new warning, but it doesn't seem possible without also disabling
unused_imports.)Steps
Possible Solution(s)
Maybe it would be helpful to have 2 separate warnings: the old
unused_importswarning, and a separateredundant_importswarning?Version