diff options
| author | bors <bors@rust-lang.org> | 2022-01-17 14:50:50 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-17 14:50:50 +0000 | 
| commit | ee5d8d37baaf5b5a81a98396952839c73ae41c68 (patch) | |
| tree | ebabac34dff17c1f20235e84bf69d727ac7fdb14 /compiler/rustc_trait_selection/src/traits/codegen.rs | |
| parent | a34c0797528172ede89480e3033f7a5e71ea4735 (diff) | |
| parent | be6d6934b635a8c2e8ff5bb68002a3744dd47e8d (diff) | |
| download | rust-ee5d8d37baaf5b5a81a98396952839c73ae41c68.tar.gz rust-ee5d8d37baaf5b5a81a98396952839c73ae41c68.zip | |
Auto merge of #90986 - camsteffen:nested-filter, r=cjgillot
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`.
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/codegen.rs')
0 files changed, 0 insertions, 0 deletions
