Struct rustc_middle::ty::visit::RegionVisitor
source · struct RegionVisitor<F> {
outer_index: DebruijnIndex,
callback: F,
}Fields§
§outer_index: DebruijnIndexThe index of a binder just outside the things we have traversed. If we encounter a bound region bound by this binder or one outer to it, it appears free. Example:
ⓘ
for<'a> fn(for<'b> fn(), T)
// ^ ^ ^ ^
// | | | | here, would be shifted in 1
// | | | here, would be shifted in 2
// | | here, would be `INNERMOST` shifted in by 1
// | here, initially, binder would be `INNERMOST`You see that, initially, any bound value is free,
because we’ve not traversed any binders. As we pass
through a binder, we shift the outer_index by 1 to
account for the new binder that encloses us.
callback: FTrait Implementations§
source§impl<'tcx, F> TypeVisitor<'tcx> for RegionVisitor<F>where
F: FnMut(Region<'tcx>) -> bool,
impl<'tcx, F> TypeVisitor<'tcx> for RegionVisitor<F>where
F: FnMut(Region<'tcx>) -> bool,
type BreakTy = ()
fn visit_binder<T: TypeVisitable<'tcx>>(
&mut self,
t: &Binder<'tcx, T>
) -> ControlFlow<Self::BreakTy>
fn visit_region(&mut self, r: Region<'tcx>) -> ControlFlow<Self::BreakTy>
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy>
fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy>
fn visit_predicate(&mut self, p: Predicate<'tcx>) -> ControlFlow<Self::BreakTy>
Auto Trait Implementations§
impl<F> RefUnwindSafe for RegionVisitor<F>where
F: RefUnwindSafe,
impl<F> Send for RegionVisitor<F>where
F: Send,
impl<F> Sync for RegionVisitor<F>where
F: Sync,
impl<F> Unpin for RegionVisitor<F>where
F: Unpin,
impl<F> UnwindSafe for RegionVisitor<F>where
F: UnwindSafe,
Blanket Implementations§
source§impl<T, R> InternIteratorElement<T, R> for T
impl<T, R> InternIteratorElement<T, R> for T
type Output = R
fn intern_with<I, F>(iter: I, f: F) -> <T as InternIteratorElement<T, R>>::Outputwhere
I: Iterator<Item = T>,
F: FnOnce(&[T]) -> R,
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error(tcx: Tcx, _: &[QueryInfo]) -> T
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.