Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd _post methods for blocks and crates #31562
Conversation
rust-highfive
assigned
nikomatsakis
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
r? @Manishearth – I always forget which way 'round... |
rust-highfive
assigned
Manishearth
and unassigned
nikomatsakis
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
Could we have one for items too? That sounds like another logical thing to have a post-check for. |
This comment has been minimized.
This comment has been minimized.
|
Sure. I've got the commit here, but my notebook network is flaky. Will commit soon. |
This comment has been minimized.
This comment has been minimized.
|
@Manishearth done. |
This comment has been minimized.
This comment has been minimized.
|
r=me, but also asking @eddyb for a second opinion |
This comment has been minimized.
This comment has been minimized.
|
I think we should try to experiment with a way to avoid combinatoric explosion, perhaps |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
oli-obk
reviewed
Feb 12, 2016
| @@ -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); | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks, @oli-obk ! Good catch. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
llogiq commentedFeb 11, 2016
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?