-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
It's a minor point, but the macro struct includes a path:
Lines 1223 to 1228 in 551244f
| #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] | |
| pub struct Mac_ { | |
| pub path: Path, | |
| pub delim: MacDelimiter, | |
| pub tts: ThinTokenStream, | |
| } |
However, the walk_mac helper just ignores this completely:
Lines 650 to 652 in 551244f
| pub fn walk_mac<'a, V: Visitor<'a>>(_: &mut V, _: &Mac) { | |
| // Empty! | |
| } |
As a result — well, a partial result — the early lint checker just ignores this path altogether (in particular, visit_path is never invoked, and hence check_path and friends are not invoked):
rust/src/librustc/lint/context.rs
Lines 1119 to 1121 in 551244f
| fn visit_mac(&mut self, mac: &'a ast::Mac) { | |
| run_lints!(self, check_mac, mac); | |
| } |
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, and walk_mac did what it was supposed to do and walked all the subparts, then everything would be fine.
Adding a hacky fix for now.