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<TyCtxt<'tcx>> for RegionVisitor<F>where
F: FnMut(Region<'tcx>) -> bool,
impl<'tcx, F> TypeVisitor<TyCtxt<'tcx>> for RegionVisitor<F>where F: FnMut(Region<'tcx>) -> bool,
type BreakTy = ()
fn visit_binder<T: TypeVisitable<TyCtxt<'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>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
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, D> Value<Tcx, D> for Twhere
Tcx: DepContext,
D: DepKind,
impl<Tcx, T, D> Value<Tcx, D> for Twhere Tcx: DepContext, D: DepKind,
default fn from_cycle_error(tcx: Tcx, _: &[QueryInfo<D>]) -> 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.