pub struct RegionFolder<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    current_index: DebruijnIndex,
    fold_region_fn: &'a mut (dyn FnMut(Region<'tcx>, DebruijnIndex) -> Region<'tcx> + 'a),
}
Expand description

Folds over the substructure of a type, visiting its component types and all regions that occur free within it.

That is, Ty can contain function or method types that bind regions at the call site (ReLateBound), and occurrences of regions (aka “lifetimes”) that are bound within a type are not visited by this folder; only regions that occur free will be visited by fld_r.

Fields

tcx: TyCtxt<'tcx>current_index: DebruijnIndex

Stores the index of a binder just outside the stuff we have visited. So this begins as INNERMOST; when we pass through a binder, it is incremented (via shift_in).

fold_region_fn: &'a mut (dyn FnMut(Region<'tcx>, DebruijnIndex) -> Region<'tcx> + 'a)

Callback invokes for each free region. The DebruijnIndex points to the binder just outside the ones we have passed through.

Implementations

Trait Implementations

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes