Enum rustc_typeck::hir::intravisit::NestedVisitorMap
[−]
[src]
pub enum NestedVisitorMap<'this, 'tcx> where 'tcx: 'this {
None,
OnlyBodies(&'this Map<'tcx>),
All(&'this Map<'tcx>),
}
rustc_private
)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
None
rustc_private
)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.
OnlyBodies(&'this Map<'tcx>)
rustc_private
)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 commmon pattern is
to use tcx.visit_all_item_likes_in_krate()
as an outer loop,
and to have the visitor that visits the contents of each item
using this setting.
All(&'this Map<'tcx>)
rustc_private
)Visit 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()
.
Methods
impl<'this, 'tcx> NestedVisitorMap<'this, 'tcx>
[src]
fn intra(self) -> Option<&'this Map<'tcx>>
rustc_private
)Returns the map to use for an "intra item-like" thing (if any). e.g., function body.
fn inter(self) -> Option<&'this Map<'tcx>>
rustc_private
)Returns the map to use for an "item-like" thing (if any). e.g., item, impl-item.