-
-
Notifications
You must be signed in to change notification settings - Fork 15k
libsyntax visitor does not visit the paths in macros #54110
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-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.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.
Description
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-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.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.
It's a minor point, but the macro struct includes a path:
rust/src/libsyntax/ast.rs
Lines 1223 to 1228 in 551244f
However, the
walk_machelper just ignores this completely:rust/src/libsyntax/visit.rs
Lines 650 to 652 in 551244f
As a result — well, a partial result — the early lint checker just ignores this
pathaltogether (in particular,visit_pathis never invoked, and hencecheck_pathand friends are not invoked):rust/src/librustc/lint/context.rs
Lines 1119 to 1121 in 551244f
This was a contributing factor to #53686.
I say that this is a "partial result" because the early lint checker never calls
walk_mac-- but, really, it ought to. And, if it did, andwalk_macdid what it was supposed to do and walked all the subparts, then everything would be fine.Adding a hacky fix for now.