Struct At
pub struct At<'a, 'db> {
pub infcx: &'a InferCtxt<'db>,
pub cause: &'a ObligationCause,
pub param_env: ParamEnv<'db>,
}Fields§
§infcx: &'a InferCtxt<'db>§cause: &'a ObligationCause§param_env: ParamEnv<'db>Implementations§
§impl<'a, 'db> At<'a, 'db>
impl<'a, 'db> At<'a, 'db>
pub fn sup<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
pub fn sup<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
Makes actual <: expected. For example, if type-checking a
call like foo(x), where foo: fn(i32), you might have
sup(i32, x), since the “expected” type is the type that
appears in the signature.
pub fn sub<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
pub fn sub<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
Makes expected <: actual.
pub fn eq<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: Relate<DbInterner<'db>>,
pub fn eq<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: Relate<DbInterner<'db>>,
Makes expected == actual.
pub fn relate<T>(
self,
expected: T,
variance: Variance,
actual: T,
) -> Result<InferOk<'db, ()>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
pub fn deeply_normalize<T>(
self,
value: T,
) -> Result<T, Vec<NextSolverError<'db>>>where
T: TypeFoldable<DbInterner<'db>>,
pub fn deeply_normalize<T>(
self,
value: T,
) -> Result<T, Vec<NextSolverError<'db>>>where
T: TypeFoldable<DbInterner<'db>>,
Deeply normalizes value, replacing all aliases which can by normalized in
the current environment. This errors in case normalization fails or is ambiguous.
pub fn lub<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, T>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
pub fn lub<T>(
self,
expected: T,
actual: T,
) -> Result<InferOk<'db, T>, TypeError<DbInterner<'db>>>where
T: ToTrace<'db>,
Computes the least-upper-bound, or mutual supertype, of two values. The order of the arguments doesn’t matter, but since this can result in an error (e.g., if asked to compute LUB of u32 and i32), it is meaningful to call one of them the “expected type”.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'db> Freeze for At<'a, 'db>
impl<'a, 'db> !RefUnwindSafe for At<'a, 'db>
impl<'a, 'db> !Send for At<'a, 'db>
impl<'a, 'db> !Sync for At<'a, 'db>
impl<'a, 'db> Unpin for At<'a, 'db>
impl<'a, 'db> !UnwindSafe for At<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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