Skip to main content

SymGenericTerm

Enum SymGenericTerm 

Source
pub enum SymGenericTerm<'db> {
    Type(SymTy<'db>),
    Perm(SymPerm<'db>),
    Place(SymPlace<'db>),
    Error(Reported),
}
Expand description

Value of a generic parameter

Variants§

§

Type(SymTy<'db>)

§

Perm(SymPerm<'db>)

§

Place(SymPlace<'db>)

§

Error(Reported)

Implementations§

Source§

impl<'db> SymGenericTerm<'db>

Source

pub fn assert_type(self, db: &'db dyn Db) -> SymTy<'db>

Source

pub fn assert_perm(self, db: &'db dyn Db) -> SymPerm<'db>

Source

pub fn assert_place(self, db: &'db dyn Db) -> SymPlace<'db>

Source

pub fn kind(self) -> Errors<SymGenericKind>

Returns the kind of term (or Err if it is an error).

Source

pub fn has_kind(self, _db: &'db dyn Db, kind: SymGenericKind) -> bool

True if self is an error or if it has the given kind.

Source

pub fn as_infer(self, db: &'db dyn Db) -> Option<InferVarIndex>

Returns the inference variable index if self is an inference variable.

Source

pub fn describe(&self) -> String

Returns a string describing self, similar to “type X

Source

pub fn fallback(db: &'db dyn Db, kind: InferVarKind) -> Self

Trait Implementations§

Source§

impl<'db> Applicable<'db> for SymGenericTerm<'db>

Source§

fn apply_from(self, db: &'db dyn Db, perm: SymPerm<'db>) -> Self

Source§

impl<'db> AssertKind<'db, SymPerm<'db>> for SymGenericTerm<'db>

Source§

fn assert_kind(self, db: &'db dyn Db) -> SymPerm<'db>

Source§

impl<'db> AssertKind<'db, SymPlace<'db>> for SymGenericTerm<'db>

Source§

fn assert_kind(self, db: &'db dyn Db) -> SymPlace<'db>

Source§

impl<'db> AssertKind<'db, SymTy<'db>> for SymGenericTerm<'db>

Source§

fn assert_kind(self, db: &'db dyn Db) -> SymTy<'db>

Source§

impl<'db> Clone for SymGenericTerm<'db>

Source§

fn clone(&self) -> SymGenericTerm<'db>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'db> Debug for SymGenericTerm<'db>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SymGenericTerm<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'db> Err<'db> for SymGenericTerm<'db>

Source§

fn err(_db: &'db dyn Db, reported: Reported) -> Self

Source§

impl<'db> From<Reported> for SymGenericTerm<'db>

Source§

fn from(value: Reported) -> Self

Converts to this type from the input type.
Source§

impl<'db> From<SymPerm<'db>> for SymGenericTerm<'db>

Source§

fn from(value: SymPerm<'db>) -> Self

Converts to this type from the input type.
Source§

impl<'db> From<SymPlace<'db>> for SymGenericTerm<'db>

Source§

fn from(value: SymPlace<'db>) -> Self

Converts to this type from the input type.
Source§

impl<'db> From<SymTy<'db>> for SymGenericTerm<'db>

Source§

fn from(value: SymTy<'db>) -> Self

Converts to this type from the input type.
Source§

impl<'db> FromInferVar<'db> for SymGenericTerm<'db>

Source§

fn infer(db: &'db dyn Db, kind: SymGenericKind, index: InferVarIndex) -> Self

Source§

impl<'db> FromVar<'db> for SymGenericTerm<'db>

Source§

fn var(db: &'db dyn Db, var: SymVariable<'db>) -> Self

Source§

impl<'db> HasKind<'db> for SymGenericTerm<'db>

Source§

fn has_kind(&self, _db: &'db dyn Db, kind: SymGenericKind) -> bool

Source§

impl<'db> Hash for SymGenericTerm<'db>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'db> Ord for SymGenericTerm<'db>

Source§

fn cmp(&self, other: &SymGenericTerm<'db>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'db> PartialEq for SymGenericTerm<'db>

Source§

fn eq(&self, other: &SymGenericTerm<'db>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'db> PartialOrd for SymGenericTerm<'db>

Source§

fn partial_cmp(&self, other: &SymGenericTerm<'db>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'db> Serialize for SymGenericTerm<'db>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'db> Subst<'db> for SymGenericTerm<'db>

Source§

type GenericTerm = SymGenericTerm<'db>

The notion of generic term appropriate for this type. When we substitute variables, this is the type of value that we replace them with.
Source§

fn subst_vars( &self, db: &'db dyn Db, map: &Map<SymVariable<'db>, Self::GenericTerm>, ) -> Self::Output

Returns a version of self where universal free variables have been replaced by the corresponding entry in terms. If a variable is not present in terms it is not substituted.
Source§

fn subst_var( &self, db: &'db dyn Db, var: SymVariable<'db>, term: Self::GenericTerm, ) -> Self::Output

Replace the variable var with term.
Source§

fn resolve_infer_var( &self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>, ) -> Self::Output

Replace all inference variables with whatever is returned by op; if op returns None, the inference variable is left unchanged.
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymExpr<'db>

Source§

type Output = SymExpr<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymExprKind<'db>

Source§

type Output = SymExprKind<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymFunctionSignature<'db>

Source§

type Output = SymFunctionSignature<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymGenericTerm<'db>

Source§

type Output = SymGenericTerm<'db>

The type of the resulting term; typically Self but not always.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymInputOutput<'db>

Source§

type Output = SymInputOutput<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymMatchArm<'db>

Source§

type Output = SymMatchArm<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymPerm<'db>

Source§

type Output = SymPerm<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymPlace<'db>

Source§

type Output = SymPlace<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymPlaceExpr<'db>

Source§

type Output = SymPlaceExpr<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymPlaceExprKind<'db>

Source§

type Output = SymPlaceExprKind<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymTy<'db>

Source§

type Output = SymTy<'db>

The type of the resulting term; typically Self but not always.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymWhereClause<'db>

Source§

type Output = SymWhereClause<'db>

The type of the resulting term; typically Self but not always.
Source§

fn identity(&self) -> Self::Output

Reproduce self with no edits.
Source§

fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output

Replace self applying the changes from subst_fns. Read more
Source§

impl<'db> ToRedTy<'db> for SymGenericTerm<'db>

Source§

fn to_red_ty(&self, env: &mut Env<'db>) -> (RedTy<'db>, SymPerm<'db>)

Source§

impl<'db> Update for SymGenericTerm<'db>

Source§

unsafe fn maybe_update(old_pointer_: *mut Self, new_value_: Self) -> bool

Returns Read more
Source§

impl<'db> Copy for SymGenericTerm<'db>

Source§

impl<'db> Eq for SymGenericTerm<'db>

Source§

impl<'db> StructuralPartialEq for SymGenericTerm<'db>

Auto Trait Implementations§

§

impl<'db> Freeze for SymGenericTerm<'db>

§

impl<'db> !RefUnwindSafe for SymGenericTerm<'db>

§

impl<'db> Send for SymGenericTerm<'db>

§

impl<'db> Sync for SymGenericTerm<'db>

§

impl<'db> Unpin for SymGenericTerm<'db>

§

impl<'db> UnsafeUnpin for SymGenericTerm<'db>

§

impl<'db> !UnwindSafe for SymGenericTerm<'db>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> HashEqLike<&T> for T
where T: Hash + Eq,

§

fn hash<H>(&self, h: &mut H)
where H: Hasher,

§

fn eq(&self, data: &&T) -> bool

§

impl<T> HashEqLike<T> for T
where T: Hash + Eq,

§

fn hash<H>(&self, h: &mut H)
where H: Hasher,

§

fn eq(&self, data: &T) -> bool

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Lookup<T> for T

§

fn into_owned(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DebugArgument for T
where T: Debug,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T