pub(crate) struct BoundVarReplacer<'db, D> {
interner: DbInterner<'db>,
current_index: DebruijnIndex,
delegate: D,
}Expand description
Replaces the escaping bound vars (late bound regions or bound types) in a type.
Fields§
§interner: DbInterner<'db>§current_index: DebruijnIndexAs with RegionFolder, represents the index of a binder just outside
the ones we have visited.
delegate: DImplementations§
Source§impl<'db, D: BoundVarReplacerDelegate<'db>> BoundVarReplacer<'db, D>
impl<'db, D: BoundVarReplacerDelegate<'db>> BoundVarReplacer<'db, D>
pub(crate) fn new(tcx: DbInterner<'db>, delegate: D) -> Self
Trait Implementations§
Source§impl<'db, D> TypeFolder<DbInterner<'db>> for BoundVarReplacer<'db, D>where
D: BoundVarReplacerDelegate<'db>,
impl<'db, D> TypeFolder<DbInterner<'db>> for BoundVarReplacer<'db, D>where
D: BoundVarReplacerDelegate<'db>,
fn cx(&self) -> DbInterner<'db>
fn fold_binder<T: TypeFoldable<DbInterner<'db>>>( &mut self, t: Binder<'db, T>, ) -> Binder<'db, T>
fn fold_ty(&mut self, t: Ty<'db>) -> Ty<'db>
fn fold_region(&mut self, r: Region<'db>) -> Region<'db>
fn fold_const(&mut self, ct: Const<'db>) -> Const<'db>
fn fold_predicate(&mut self, p: Predicate<'db>) -> Predicate<'db>
fn fold_clauses( &mut self, c: <I as Interner>::Clauses, ) -> <I as Interner>::Clauses
Auto Trait Implementations§
impl<'db, D> Freeze for BoundVarReplacer<'db, D>where
D: Freeze,
impl<'db, D> !RefUnwindSafe for BoundVarReplacer<'db, D>
impl<'db, D> Send for BoundVarReplacer<'db, D>where
D: Send,
impl<'db, D> Sync for BoundVarReplacer<'db, D>where
D: Sync,
impl<'db, D> Unpin for BoundVarReplacer<'db, D>where
D: Unpin,
impl<'db, D> UnsafeUnpin for BoundVarReplacer<'db, D>where
D: UnsafeUnpin,
impl<'db, D> !UnwindSafe for BoundVarReplacer<'db, D>
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
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more