Skip to content

do not lint non_camel_case_types, unused_parens, unused_braces and unused_qualifications on items from external macros - #166682

Open
Albab-Hasan wants to merge 2 commits into
rust-lang:mainfrom
Albab-Hasan:early-lints-skip-external-macro-items
Open

Albab-Hasan wants to merge 2 commits into
rust-lang:mainfrom
Albab-Hasan:early-lints-skip-external-macro-items

Conversation

@Albab-Hasan

Copy link
Copy Markdown
Contributor

second half of #166634. derived impls copy spans from the derive input so these four lints fired again on the generated impl and #[expect] on the struct did not cover it.

early lints have no owner to check so EarlyContext now tracks whether an enclosing item comes from an external macro. resolve checks its current item for unused_qualifications.

as suggested in #158943 (comment)

r? @petrochenkov

…and `unused_qualifications` on items from external macros

derived impls keep the spans of the derive input so the external macro check on the lint span misses them. early lints now track whether an enclosing item comes from an external macro, and resolve checks the item it is currently in.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants