Enum rustc_hir::intravisit::NestedVisitorMap [−][src]
pub enum NestedVisitorMap<M> {
None,
OnlyBodies(M),
All(M),
}
Expand description
Specifies what nested things a visitor wants to visit. The most
common choice is OnlyBodies
, which will cause the visitor to
visit fn bodies for fns that it encounters, but skip over nested
item-like things.
See the comments on ItemLikeVisitor
for more details on the overall
visit strategy.
Variants
Do not visit any nested things. When you add a new “non-nested” thing, you will want to audit such uses to see if they remain valid.
Use this if you are only walking some particular kind of tree (i.e., a type, or fn signature) and you don’t want to thread a HIR map around.
Do not visit nested item-like things, but visit nested things that are inside of an item-like.
This is the most common choice. A very common pattern is
to use visit_all_item_likes()
as an outer loop,
and to have the visitor that visits the contents of each item
using this setting.
Visits all nested things, including item-likes.
This is an unusual choice. It is used when you want to
process everything within their lexical context. Typically you
kick off the visit by doing walk_krate()
.
Implementations
Auto Trait Implementations
impl<M> RefUnwindSafe for NestedVisitorMap<M> where
M: RefUnwindSafe,
impl<M> Send for NestedVisitorMap<M> where
M: Send,
impl<M> Sync for NestedVisitorMap<M> where
M: Sync,
impl<M> Unpin for NestedVisitorMap<M> where
M: Unpin,
impl<M> UnwindSafe for NestedVisitorMap<M> where
M: UnwindSafe,
Blanket Implementations
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.