pub struct NormalizationFolder<'a, Infcx, I, F>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,{
infcx: &'a Infcx,
universes: Vec<Option<UniverseIndex>>,
stalled_goals: Vec<Goal<I, I::Predicate>>,
normalize: F,
}Expand description
This folder normalizes value and collects ambiguous goals.
Note that for ambiguous alias which contains escaping bound vars, we just return the original alias and don’t collect the ambiguous goal.
Fields§
§infcx: &'a Infcx§universes: Vec<Option<UniverseIndex>>§stalled_goals: Vec<Goal<I, I::Predicate>>§normalize: FImplementations§
Source§impl<'a, Infcx, I, F> NormalizationFolder<'a, Infcx, I, F>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
F: FnMut(I::Term) -> Result<(I::Term, Option<Goal<I, I::Predicate>>), NoSolution>,
impl<'a, Infcx, I, F> NormalizationFolder<'a, Infcx, I, F>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
F: FnMut(I::Term) -> Result<(I::Term, Option<Goal<I, I::Predicate>>), NoSolution>,
pub fn new( infcx: &'a Infcx, universes: Vec<Option<UniverseIndex>>, stalled_goals: Vec<Goal<I, I::Predicate>>, normalize: F, ) -> Self
pub fn stalled_goals(self) -> Vec<Goal<I, I::Predicate>>
fn normalize_alias_term( &mut self, alias_term: I::Term, has_escaping: HasEscapingBoundVars, ) -> Result<I::Term, NoSolution>
Trait Implementations§
Source§impl<'a, Infcx, I, F> FallibleTypeFolder<I> for NormalizationFolder<'a, Infcx, I, F>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
F: FnMut(I::Term) -> Result<(I::Term, Option<Goal<I, I::Predicate>>), NoSolution>,
impl<'a, Infcx, I, F> FallibleTypeFolder<I> for NormalizationFolder<'a, Infcx, I, F>where
Infcx: InferCtxtLike<Interner = I>,
I: Interner,
F: FnMut(I::Term) -> Result<(I::Term, Option<Goal<I, I::Predicate>>), NoSolution>,
type Error = NoSolution
fn cx(&self) -> I
fn try_fold_binder<T: TypeFoldable<I>>( &mut self, t: Binder<I, T>, ) -> Result<Binder<I, T>, Self::Error>
fn try_fold_ty(&mut self, ty: I::Ty) -> Result<I::Ty, Self::Error>
fn try_fold_const(&mut self, ct: I::Const) -> Result<I::Const, Self::Error>
fn try_fold_region( &mut self, r: <I as Interner>::Region, ) -> Result<<I as Interner>::Region, Self::Error>
fn try_fold_predicate( &mut self, p: <I as Interner>::Predicate, ) -> Result<<I as Interner>::Predicate, Self::Error>
fn try_fold_clauses( &mut self, c: <I as Interner>::Clauses, ) -> Result<<I as Interner>::Clauses, Self::Error>
Auto Trait Implementations§
impl<'a, Infcx, I, F> DynSend for NormalizationFolder<'a, Infcx, I, F>
impl<'a, Infcx, I, F> DynSync for NormalizationFolder<'a, Infcx, I, F>
impl<'a, Infcx, I, F> Freeze for NormalizationFolder<'a, Infcx, I, F>where
F: Freeze,
impl<'a, Infcx, I, F> RefUnwindSafe for NormalizationFolder<'a, Infcx, I, F>where
F: RefUnwindSafe,
Infcx: RefUnwindSafe,
<I as Interner>::ParamEnv: RefUnwindSafe,
<I as Interner>::Predicate: RefUnwindSafe,
impl<'a, Infcx, I, F> Send for NormalizationFolder<'a, Infcx, I, F>
impl<'a, Infcx, I, F> Sync for NormalizationFolder<'a, Infcx, I, F>
impl<'a, Infcx, I, F> Unpin for NormalizationFolder<'a, Infcx, I, F>
impl<'a, Infcx, I, F> UnsafeUnpin for NormalizationFolder<'a, Infcx, I, F>where
F: UnsafeUnpin,
impl<'a, Infcx, I, F> UnwindSafe for NormalizationFolder<'a, Infcx, I, F>where
F: UnwindSafe,
Infcx: RefUnwindSafe,
<I as Interner>::ParamEnv: UnwindSafe,
<I as Interner>::Predicate: 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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
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.