pub enum BuiltinTypeConstructorKind {
Ptr,
MutPtr,
Ref,
MutRef,
Slice,
MutSlice,
Vec,
}Expand description
Identifier for a built-in parameterized type.
Each variant corresponds to a closed, compiler-recognized type constructor
(e.g. Ptr(T), MutPtr(T)). The actual lowering to a TypeKind happens
in sema (gruel-air), which dispatches on this tag — gruel-builtins
has no dependency on the type system.
New constructors are added by extending this enum, adding an entry to
BUILTIN_TYPE_CONSTRUCTORS, and adding a corresponding sema lowering
arm. Exhaustive matches in sema force you to add the lowering arm when
adding a variant — that’s intentional, so the enum is not marked
#[non_exhaustive].
Variants§
Ptr
Immutable raw pointer (ADR-0061): Ptr(T) lowers to TypeKind::PtrConst.
MutPtr
Mutable raw pointer (ADR-0061): MutPtr(T) lowers to TypeKind::PtrMut.
Ref
Immutable reference (ADR-0062): Ref(T) lowers to TypeKind::Ref.
MutRef
Mutable reference (ADR-0062): MutRef(T) lowers to TypeKind::MutRef.
Slice
Immutable slice (ADR-0064): Slice(T) lowers to TypeKind::Slice.
MutSlice
Mutable slice (ADR-0064): MutSlice(T) lowers to TypeKind::MutSlice.
Vec
Owned vector (ADR-0066): Vec(T) lowers to TypeKind::Vec.
Trait Implementations§
Source§impl Clone for BuiltinTypeConstructorKind
impl Clone for BuiltinTypeConstructorKind
Source§fn clone(&self) -> BuiltinTypeConstructorKind
fn clone(&self) -> BuiltinTypeConstructorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more