Struct VerifyIfEq
pub struct VerifyIfEq<'db> {
pub ty: Ty<'db>,
pub bound: Region<'db>,
}Expand description
This is a “conditional bound” that checks the result of inference and supplies a bound if it ended up being relevant. It’s used in situations like this:
fn foo<'a, 'b, T: SomeTrait<'a>>
where
<T as SomeTrait<'a>>::Item: 'bIf we have an obligation like <T as SomeTrait<'?x>>::Item: 'c, then
we don’t know yet whether it suffices to show that 'b: 'c. If '?x winds
up being equal to 'a, then the where-clauses on function applies, and
in that case we can show 'b: 'c. But if '?x winds up being something
else, the bound isn’t relevant.
In the VerifyBound, this struct is enclosed in Binder to account
for cases like
where for<'a> <T as SomeTrait<'a>::Item: 'aThe idea is that we have to find some instantiation of 'a that can
make <T as SomeTrait<'a>>::Item equal to the final value of G,
the generic we are checking.
fn(min) -> bool {
exists<'a> {
if G == K {
B(min)
} else {
false
}
}
}Fields§
§ty: Ty<'db>Type which must match the generic G
bound: Region<'db>Bound that applies if ty is equal.
Trait Implementations§
§impl<'db> Clone for VerifyIfEq<'db>
impl<'db> Clone for VerifyIfEq<'db>
§fn clone(&self) -> VerifyIfEq<'db>
fn clone(&self) -> VerifyIfEq<'db>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'db> Freeze for VerifyIfEq<'db>
impl<'db> RefUnwindSafe for VerifyIfEq<'db>
impl<'db> Send for VerifyIfEq<'db>
impl<'db> Sync for VerifyIfEq<'db>
impl<'db> Unpin for VerifyIfEq<'db>
impl<'db> UnwindSafe for VerifyIfEq<'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
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>
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>
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