Enum chalk_solve::infer::var::InferenceValue
source · pub enum InferenceValue<I: Interner> {
Unbound(UniverseIndex),
Bound(GenericArg<I>),
}
Expand description
The value of an inference variable. We start out as Unbound
with a
universe index; when the inference variable is assigned a value, it becomes
bound and records that value. See EnaVariable
for more details.
Variants§
Unbound(UniverseIndex)
Bound(GenericArg<I>)
Implementations§
source§impl<I: Interner> InferenceValue<I>
impl<I: Interner> InferenceValue<I>
pub fn from_ty(interner: I, ty: Ty<I>) -> Self
pub fn from_lifetime(interner: I, lifetime: Lifetime<I>) -> Self
pub fn from_const(interner: I, constant: Const<I>) -> Self
Trait Implementations§
source§impl<I: Clone + Interner> Clone for InferenceValue<I>
impl<I: Clone + Interner> Clone for InferenceValue<I>
source§fn clone(&self) -> InferenceValue<I>
fn clone(&self) -> InferenceValue<I>
Returns a copy 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 moresource§impl<I: PartialEq + Interner> PartialEq for InferenceValue<I>
impl<I: PartialEq + Interner> PartialEq for InferenceValue<I>
source§fn eq(&self, other: &InferenceValue<I>) -> bool
fn eq(&self, other: &InferenceValue<I>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<I: Interner> UnifyValue for InferenceValue<I>
impl<I: Interner> UnifyValue for InferenceValue<I>
§type Error = (InferenceValue<I>, InferenceValue<I>)
type Error = (InferenceValue<I>, InferenceValue<I>)
Defines the type to return when merging of two values fails.
If merging is infallible, use the special struct
NoError
found in this crate, which unlocks various more convenient
methods on the unification table.source§fn unify_values(
a: &InferenceValue<I>,
b: &InferenceValue<I>,
) -> Result<InferenceValue<I>, (InferenceValue<I>, InferenceValue<I>)>
fn unify_values( a: &InferenceValue<I>, b: &InferenceValue<I>, ) -> Result<InferenceValue<I>, (InferenceValue<I>, InferenceValue<I>)>
Given two values, produce a new value that combines them.
If that is not possible, produce an error.
impl<I: Eq + Interner> Eq for InferenceValue<I>
impl<I: Interner> StructuralPartialEq for InferenceValue<I>
Auto Trait Implementations§
impl<I> Freeze for InferenceValue<I>
impl<I> RefUnwindSafe for InferenceValue<I>
impl<I> Send for InferenceValue<I>
impl<I> Sync for InferenceValue<I>
impl<I> Unpin for InferenceValue<I>
impl<I> UnwindSafe for InferenceValue<I>
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> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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<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.