-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
unused_qualifications lints on macro-generated paths which happen to have spans from the input #122519
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.L-unused_qualificationsLint: unused_qualificationsLint: unused_qualificationsP-mediumMedium priorityMedium priorityT-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.L-unused_qualificationsLint: unused_qualificationsLint: unused_qualificationsP-mediumMedium priorityMedium priorityT-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
Current output
Desired output
No warning.
Rationale and extra context
Rationale:
#[allow(unused_qualifications)]to solve this problem, but that would be additional busywork for macro authors.Therefore, I propose that
unused_qualificationsshould not lint on a path unless the tokens that it proposes deleting all have spans from the original source text (not any other spans that a macro might produce).There is currently a PR out for not linting on absolute paths, which would also fix this problem, but I don't understand the rationale for doing that outside of macros, so I'm filing this issue for consideration of the specific case of macros.
Other cases
This occurs only on nightly, not on stable 1.76.0 or beta.
For some reason, among all the proc macros in use in the project I'm testing on nightly, only
bytemuckis affected.Rust Version
Anything else?
@rustbot label +regression-from-stable-to-nightly