pub enum CanonicalTyVarKind {
General(UniverseIndex),
Int,
Float,
}
Expand description
Rust actually has more than one category of type variables; notably, the type variables we create for literals (e.g., 22 or 22.) can only be instantiated with integral/float types (e.g., usize or f32). In order to faithfully reproduce a type, we need to know what set of types a given type variable can be unified with.
Variants§
General(UniverseIndex)
General type variable ?T
that can be unified with arbitrary types.
Int
Integral type variable ?I
(that can only be unified with integral types).
Float
Floating-point type variable ?F
(that can only be unified with float types).
Trait Implementations§
source§impl Clone for CanonicalTyVarKind
impl Clone for CanonicalTyVarKind
source§fn clone(&self) -> CanonicalTyVarKind
fn clone(&self) -> CanonicalTyVarKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CanonicalTyVarKind
impl Debug for CanonicalTyVarKind
source§impl<__D: TyDecoder> Decodable<__D> for CanonicalTyVarKind
impl<__D: TyDecoder> Decodable<__D> for CanonicalTyVarKind
source§impl<__E: TyEncoder> Encodable<__E> for CanonicalTyVarKind
impl<__E: TyEncoder> Encodable<__E> for CanonicalTyVarKind
source§impl Hash for CanonicalTyVarKind
impl Hash for CanonicalTyVarKind
source§impl<__CTX> HashStable<__CTX> for CanonicalTyVarKind
impl<__CTX> HashStable<__CTX> for CanonicalTyVarKind
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
source§impl PartialEq for CanonicalTyVarKind
impl PartialEq for CanonicalTyVarKind
source§fn eq(&self, other: &CanonicalTyVarKind) -> bool
fn eq(&self, other: &CanonicalTyVarKind) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for CanonicalTyVarKind
impl Eq for CanonicalTyVarKind
impl StructuralPartialEq for CanonicalTyVarKind
Auto Trait Implementations§
impl DynSend for CanonicalTyVarKind
impl DynSync for CanonicalTyVarKind
impl Freeze for CanonicalTyVarKind
impl RefUnwindSafe for CanonicalTyVarKind
impl Send for CanonicalTyVarKind
impl Sync for CanonicalTyVarKind
impl Unpin for CanonicalTyVarKind
impl UnwindSafe for CanonicalTyVarKind
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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
§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
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes
Size for each variant:
General
: 4 bytesInt
: 0 bytesFloat
: 0 bytes