libsyntax visitor does not visit the paths in macros #54110
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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_mac
helper 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
path
altogether (in particular,visit_path
is never invoked, and hencecheck_path
and 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_mac
did what it was supposed to do and walked all the subparts, then everything would be fine.Adding a hacky fix for now.
The text was updated successfully, but these errors were encountered: