pub struct BoundVarReplacer<'a, Infcx, I = <Infcx as InferCtxtLike>::Interner>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,{ /* private fields */ }Implementations§
Source§impl<'a, Infcx, I> BoundVarReplacer<'a, Infcx, I>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
impl<'a, Infcx, I> BoundVarReplacer<'a, Infcx, I>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
Sourcepub fn replace_bound_vars<T: TypeFoldable<I>>(
infcx: &'a Infcx,
universe_indices: &'a mut Vec<Option<UniverseIndex>>,
value: T,
) -> (T, IndexMap<I::PlaceholderRegion, I::BoundRegion>, IndexMap<I::PlaceholderTy, I::BoundTy>, IndexMap<I::PlaceholderConst, I::BoundConst>)
pub fn replace_bound_vars<T: TypeFoldable<I>>( infcx: &'a Infcx, universe_indices: &'a mut Vec<Option<UniverseIndex>>, value: T, ) -> (T, IndexMap<I::PlaceholderRegion, I::BoundRegion>, IndexMap<I::PlaceholderTy, I::BoundTy>, IndexMap<I::PlaceholderConst, I::BoundConst>)
Returns Some if we were able to replace bound vars. If there are any bound vars that
use a binding level above universe_indices.len(), we fail.
Trait Implementations§
Source§impl<Infcx, I> TypeFolder<I> for BoundVarReplacer<'_, Infcx, I>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
impl<Infcx, I> TypeFolder<I> for BoundVarReplacer<'_, Infcx, I>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
fn cx(&self) -> I
fn fold_binder<T: TypeFoldable<I>>(&mut self, t: Binder<I, T>) -> Binder<I, T>
fn fold_region(&mut self, r: I::Region) -> I::Region
fn fold_ty(&mut self, t: I::Ty) -> I::Ty
fn fold_const(&mut self, ct: I::Const) -> I::Const
fn fold_predicate(&mut self, p: I::Predicate) -> I::Predicate
fn fold_clauses( &mut self, c: <I as Interner>::Clauses, ) -> <I as Interner>::Clauses
Auto Trait Implementations§
impl<'a, Infcx, I> Freeze for BoundVarReplacer<'a, Infcx, I>
impl<'a, Infcx, I> RefUnwindSafe for BoundVarReplacer<'a, Infcx, I>where
Infcx: RefUnwindSafe,
<I as Interner>::PlaceholderRegion: RefUnwindSafe,
<I as Interner>::BoundRegion: RefUnwindSafe,
<I as Interner>::PlaceholderTy: RefUnwindSafe,
<I as Interner>::BoundTy: RefUnwindSafe,
<I as Interner>::PlaceholderConst: RefUnwindSafe,
<I as Interner>::BoundConst: RefUnwindSafe,
impl<'a, Infcx, I> Send for BoundVarReplacer<'a, Infcx, I>where
Infcx: Sync,
<I as Interner>::PlaceholderRegion: Send,
<I as Interner>::BoundRegion: Send,
<I as Interner>::PlaceholderTy: Send,
<I as Interner>::BoundTy: Send,
<I as Interner>::PlaceholderConst: Send,
<I as Interner>::BoundConst: Send,
impl<'a, Infcx, I> Sync for BoundVarReplacer<'a, Infcx, I>where
Infcx: Sync,
<I as Interner>::PlaceholderRegion: Sync,
<I as Interner>::BoundRegion: Sync,
<I as Interner>::PlaceholderTy: Sync,
<I as Interner>::BoundTy: Sync,
<I as Interner>::PlaceholderConst: Sync,
<I as Interner>::BoundConst: Sync,
impl<'a, Infcx, I> Unpin for BoundVarReplacer<'a, Infcx, I>where
<I as Interner>::PlaceholderRegion: Unpin,
<I as Interner>::BoundRegion: Unpin,
<I as Interner>::PlaceholderTy: Unpin,
<I as Interner>::BoundTy: Unpin,
<I as Interner>::PlaceholderConst: Unpin,
<I as Interner>::BoundConst: Unpin,
impl<'a, Infcx, I = <Infcx as InferCtxtLike>::Interner> !UnwindSafe for BoundVarReplacer<'a, Infcx, I>
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