pub struct PlaceholderReplacer<'a, 'db> { /* private fields */ }
Expand description
The inverse of [BoundVarReplacer
]: replaces placeholders with the bound vars from which they came.
Implementations§
Source§impl<'a, 'db> PlaceholderReplacer<'a, 'db>
impl<'a, 'db> PlaceholderReplacer<'a, 'db>
pub fn replace_placeholders<T: TypeFoldable<DbInterner<'db>>>( infcx: &'a InferCtxt<'db>, mapped_regions: FxIndexMap<PlaceholderRegion, BoundRegion>, mapped_types: FxIndexMap<Placeholder<BoundTy>, BoundTy>, mapped_consts: FxIndexMap<PlaceholderConst, BoundVar>, universe_indices: &'a [Option<UniverseIndex>], value: T, ) -> T
Trait Implementations§
Source§impl<'db> TypeFolder<DbInterner<'db>> for PlaceholderReplacer<'_, 'db>
impl<'db> TypeFolder<DbInterner<'db>> for PlaceholderReplacer<'_, 'db>
fn cx(&self) -> DbInterner<'db>
fn fold_binder<T: TypeFoldable<DbInterner<'db>>>( &mut self, t: Binder<'db, T>, ) -> Binder<'db, T>
fn fold_region(&mut self, r0: Region<'db>) -> Region<'db>
fn fold_ty(&mut self, ty: Ty<'db>) -> Ty<'db>
fn fold_const(&mut self, ct: Const<'db>) -> Const<'db>
fn fold_predicate( &mut self, p: <I as Interner>::Predicate, ) -> <I as Interner>::Predicate
fn fold_clauses( &mut self, c: <I as Interner>::Clauses, ) -> <I as Interner>::Clauses
Auto Trait Implementations§
impl<'a, 'db> Freeze for PlaceholderReplacer<'a, 'db>
impl<'a, 'db> !RefUnwindSafe for PlaceholderReplacer<'a, 'db>
impl<'a, 'db> !Send for PlaceholderReplacer<'a, 'db>
impl<'a, 'db> !Sync for PlaceholderReplacer<'a, 'db>
impl<'a, 'db> Unpin for PlaceholderReplacer<'a, 'db>
impl<'a, 'db> !UnwindSafe for PlaceholderReplacer<'a, 'db>
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