-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add _post methods for blocks and crates #31562
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @Manishearth – I always forget which way 'round... |
Could we have one for items too? That sounds like another logical thing to have a post-check for. |
Sure. I've got the commit here, but my notebook network is flaky. Will commit soon. |
@Manishearth done. |
r=me, but also asking @eddyb for a second opinion |
I think we should try to experiment with a way to avoid combinatoric explosion, perhaps |
That's an interesting idea, but I don't think combinatoric explosion can happen here, or that such changes need to be made here often. An eventual new design for lint passes would be nice though. Not sure if we need it right now. |
@bors r+ |
📌 Commit d483a6e has been approved by |
FWIW, I don't think we get combinatoric explosion here. Worst (or best, depending on how you look at it) case we have an entry/exit (or check/post in our current nomenclature) for each node that contains other nodes. |
There is some duplicate error messages in the compiletest output. I doubt it has something to do with the new methods, as there is nothing that uses them yet. @bors retry |
@@ -918,6 +920,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> { | |||
run_lints!(cx, check_item, early_passes, it); | |||
cx.visit_ids(|v| v.visit_item(it)); | |||
ast_visit::walk_item(cx, it); | |||
run_lints!(cx, check_item, early_passes, it); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be check_item_post
Thanks, @oli-obk ! Good catch. |
@bors r+ |
📌 Commit a270b7b has been approved by |
This fixes #31512 for me. A bit of explanation: I want to have `check_block_post(&mut self, &Context, &Block)` and `check_crate_post(&mut self, &Context, &Crate)` methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now. @Manishearth r?
This fixes #31512 for me.
A bit of explanation: I want to have
check_block_post(&mut self, &Context, &Block)
andcheck_crate_post(&mut self, &Context, &Crate)
methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now.@Manishearth r?