Replace NestedVisitorMap with generic NestedFilter#90986
Replace NestedVisitorMap with generic NestedFilter#90986bors merged 3 commits intorust-lang:masterfrom
NestedVisitorMap with generic NestedFilter#90986Conversation
|
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
|
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
72a75e5 to
d0c8990
Compare
|
Whoops I meant to have 0 clippy changes until this gets a green light. Reverted the clippy change for now. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Seems like a great idea! |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit d0c899050fb25547aa086cf84cb380f1b60e28c5 with merge 3e581354f769b575052258b34e488fb27f0d619e... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
r? @cjgillot |
|
We can't do a perf run without fixing Clippy? |
|
I don't think so, sadly. |
|
shucks |
|
You can, just needs some manual adjustment to bootstrap - probably enough to comment Clippy out everywhere in src/bootstrap/dist.rs, roughly. |
|
☔ The latest upstream changes (presumably #90352) made this pull request unmergeable. Please resolve the merge conflicts. |
Maybe if you add a commit that removes most of clippy (remove the tests, make it an empty |
bc3d1e8 to
94b0358
Compare
94b0358 to
be6d693
Compare
|
@bors r=cjgillot (can I do this?) |
|
As a Clippy team member, you should be able to do so. But apparently it didn't work. |
|
@bors r=cjgillot |
This comment has been minimized.
This comment has been minimized.
|
lol |
|
Something was strange with bors, there were ~400+ PRs not listed in the queue. I have synchronized it, let's see if this helps |
|
@bors r=cjgillot |
|
📌 Commit be6d693 has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (ee5d8d3): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Replace `NestedVisitorMap` with generic `NestedFilter`
This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting.
With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted).
One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.
|
The documentation (https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/intravisit/trait.Visitor.html) is still outdated, talking about things like “see NestedVisitorMap for details” or “override nested_visit_map to return other than None”. |
Update intravisit docs Follow-up to rust-lang#90986. r? `@cjgillot`
This is an attempt to make the
intravisit::VisitorAPI simpler and "more const" with regard to nested visiting.With this change,
intravisit::Visitordoes not visit nested things by default, unless you specifytype NestedFilter = nested_filter::OnlyBodies(orAll).nested_visit_mapreturnsSelf::Mapinstead ofNestedVisitorMap<Self::Map>. It panics by default (unreachable iftype NestedFilteris omitted).One somewhat trixty thing here is that
nested_filter::{OnlyBodies, All}live inrustc_middleso that they may havetype Map = map::Mapand so thatimpl Visitors never need to specifytype Map- it has a default ofSelf::NestedFilter::Map.