struct Sub<'a, E> {
env: &'a mut E,
reason: ConstrReason,
span: Span,
obligations: Vec<Binder<CoroutineObligPredicate>>,
}Expand description
Context used to relate two types a and b via subtyping
Fields§
§env: &'a mut EThe environment to lookup locations pointed to by TyKind::Ptr.
reason: ConstrReason§span: Span§obligations: Vec<Binder<CoroutineObligPredicate>>FIXME(nilehmann) This is used to store coroutine obligations generated during subtyping when relating an opaque type. Other obligations related to relating opaque types are resolved directly here. The implementation is really messy and we may be missing some obligations.
Implementations§
Source§impl<'a, E: LocEnv> Sub<'a, E>
impl<'a, E: LocEnv> Sub<'a, E>
fn new(env: &'a mut E, reason: ConstrReason, span: Span) -> Self
fn tag(&self) -> Tag
fn tys( &mut self, infcx: &mut InferCtxt<'_, '_, '_>, a: &Ty, b: &Ty, ) -> InferResult
fn btys( &mut self, infcx: &mut InferCtxt<'_, '_, '_>, a: &BaseTy, b: &BaseTy, ) -> InferResult
fn generic_args( &mut self, infcx: &mut InferCtxt<'_, '_, '_>, variance: Variance, a: &GenericArg, b: &GenericArg, ) -> InferResult
fn idxs_eq(&mut self, infcx: &mut InferCtxt<'_, '_, '_>, a: &Expr, b: &Expr)
fn abs_eq(&mut self, infcx: &mut InferCtxt<'_, '_, '_>, a: &Lambda, b: &Lambda)
fn handle_opaque_type( &mut self, infcx: &mut InferCtxt<'_, '_, '_>, bty: &BaseTy, alias_ty: &AliasTy, ) -> InferResult
Auto Trait Implementations§
impl<'a, E> Freeze for Sub<'a, E>
impl<'a, E> RefUnwindSafe for Sub<'a, E>where
E: RefUnwindSafe,
impl<'a, E> Send for Sub<'a, E>where
E: Send,
impl<'a, E> Sync for Sub<'a, E>where
E: Sync,
impl<'a, E> Unpin for Sub<'a, E>
impl<'a, E> !UnwindSafe for Sub<'a, E>
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> 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