Enum rustc::hir::intravisit::NestedVisitorMap [] [src]

pub enum NestedVisitorMap<'this, 'tcx: 'this> {
    None,
    OnlyBodies(&'this Map<'tcx>),
    All(&'this Map<'tcx>),
}
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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.

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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.

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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]

[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Returns the map to use for an "item-like" thing (if any). e.g., item, impl-item.