Enum VarianceDiagInfo
pub enum VarianceDiagInfo<I>where
I: Interner,{
None,
Invariant {
ty: <I as Interner>::Ty,
param_index: u32,
},
}
Expand description
Extra information about why we ended up with a particular variance.
This is only used to add more information to error messages, and
has no effect on soundness. While choosing the ‘wrong’ VarianceDiagInfo
may lead to confusing notes in error messages, it will never cause
a miscompilation or unsoundness.
When in doubt, use VarianceDiagInfo::default()
Variants§
None
No additional information - this is the default. We will not add any additional information to error messages.
Invariant
We switched our variance because a generic argument occurs inside the invariant generic argument of another type.
Implementations§
§impl<I> VarianceDiagInfo<I>where
I: Interner,
impl<I> VarianceDiagInfo<I>where
I: Interner,
pub fn xform(self, other: VarianceDiagInfo<I>) -> VarianceDiagInfo<I>
pub fn xform(self, other: VarianceDiagInfo<I>) -> VarianceDiagInfo<I>
Mirrors Variance::xform
- used to ‘combine’ the existing
and new VarianceDiagInfo
s when our variance changes.
Trait Implementations§
§impl<I> Clone for VarianceDiagInfo<I>where
I: Interner,
impl<I> Clone for VarianceDiagInfo<I>where
I: Interner,
§fn clone(&self) -> VarianceDiagInfo<I>
fn clone(&self) -> VarianceDiagInfo<I>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<I> Debug for VarianceDiagInfo<I>where
I: Interner,
impl<I> Debug for VarianceDiagInfo<I>where
I: Interner,
§impl<I> Default for VarianceDiagInfo<I>where
I: Interner,
impl<I> Default for VarianceDiagInfo<I>where
I: Interner,
§fn default() -> VarianceDiagInfo<I>
fn default() -> VarianceDiagInfo<I>
Returns the “default value” for a type. Read more
§impl<I> PartialEq for VarianceDiagInfo<I>where
I: Interner,
impl<I> PartialEq for VarianceDiagInfo<I>where
I: Interner,
impl<I> Copy for VarianceDiagInfo<I>where
I: Interner,
impl<I> Eq for VarianceDiagInfo<I>where
I: Interner,
Auto Trait Implementations§
impl<I> Freeze for VarianceDiagInfo<I>where
<I as Interner>::Ty: Freeze,
impl<I> RefUnwindSafe for VarianceDiagInfo<I>where
<I as Interner>::Ty: RefUnwindSafe,
impl<I> Send for VarianceDiagInfo<I>where
<I as Interner>::Ty: Send,
impl<I> Sync for VarianceDiagInfo<I>where
<I as Interner>::Ty: Sync,
impl<I> Unpin for VarianceDiagInfo<I>where
<I as Interner>::Ty: Unpin,
impl<I> UnwindSafe for VarianceDiagInfo<I>where
<I as Interner>::Ty: 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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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