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

None

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(M)

Tuple Fields

0: M

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.

All(M)

Tuple Fields

0: M

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

Returns the map to use for an “intra item-like” thing (if any). E.g., function body.

Returns the map to use for an “item-like” thing (if any). E.g., item, impl-item.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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.