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).
Auto Trait Implementations
impl RefUnwindSafe for CanonicalTyVarKind
impl Send for CanonicalTyVarKind
impl Sync for CanonicalTyVarKind
impl Unpin for CanonicalTyVarKind
impl UnwindSafe for CanonicalTyVarKind
Blanket Implementations
sourceimpl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter(
arena: &'a Arena<'tcx>,
iter: impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<'tcx, T> IsSuggestable<'tcx> for Twhere
T: TypeVisitable<'tcx>,
impl<'tcx, T> IsSuggestable<'tcx> for Twhere
T: TypeVisitable<'tcx>,
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