rustc_hir::intravisit::nested_filter

Trait NestedFilter

Source
pub trait NestedFilter<'hir> {
    type Map: Map<'hir>;

    const INTER: bool;
    const INTRA: bool;
}
Expand description

Specifies what nested things a visitor wants to visit. By “nested things”, we are referring to bits of HIR that are not directly embedded within one another but rather indirectly, through a table in the crate. This is done to control dependencies during incremental compilation: the non-inline bits of HIR can be tracked and hashed separately.

The most common choice is OnlyBodies, which will cause the visitor to visit fn bodies for fns that it encounters, and closure bodies, but skip over nested item-like things.

See the comments at rustc_hir::intravisit for more details on the overall visit strategy.

Required Associated Constants§

Source

const INTER: bool

Whether the visitor visits nested “item-like” things. E.g., item, impl-item.

Source

const INTRA: bool

Whether the visitor visits “intra item-like” things. E.g., function body, closure, AnonConst

Required Associated Types§

Source

type Map: Map<'hir>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl NestedFilter<'_> for None

Source§

const INTER: bool = false

Source§

const INTRA: bool = false

Source§

type Map = !