pub enum Ty {
Show 30 variants
Bool,
Char,
Int(IntTy),
Uint(UintTy),
Float(FloatTy),
Ref {
mutable: bool,
inner: Box<Ty>,
},
RawPtr {
mutable: bool,
inner: Box<Ty>,
},
Array {
element: Box<Ty>,
size: u64,
},
Slice {
element: Box<Ty>,
},
Tuple(Vec<Ty>),
FnPtr {
params: Vec<Ty>,
return_ty: Box<Ty>,
},
Named {
def_id: HirId,
name: Symbol,
},
Generic {
def_id: HirId,
name: Symbol,
args: Vec<Ty>,
},
TypeParam {
index: u32,
name: Symbol,
},
Unit,
Never,
TraitObject {
trait_name: Symbol,
},
Task {
result_ty: Box<Ty>,
},
TaskGroup,
Channel {
element_ty: Box<Ty>,
},
Sender {
element_ty: Box<Ty>,
},
Receiver {
element_ty: Box<Ty>,
},
Closure {
id: u32,
params: Vec<Ty>,
return_ty: Box<Ty>,
capture_tys: Vec<Ty>,
},
Union {
variants: Vec<Ty>,
},
NDArray {
element: Box<Ty>,
rank: u32,
},
NDView {
element: Box<Ty>,
rank: u32,
},
CowArray {
element: Box<Ty>,
rank: u32,
},
DynArray {
element: Box<Ty>,
},
SmallVec {
element: Box<Ty>,
capacity: u32,
},
Simd {
element: Box<Ty>,
lanes: u32,
},
}Expand description
Type representation in MIR (simplified from HIR)
Variants§
Bool
Boolean
Char
Character
Int(IntTy)
Integer (signed)
Uint(UintTy)
Integer (unsigned)
Float(FloatTy)
Floating point
Ref
Reference
RawPtr
Raw pointer
Array
Array [T; N]
Slice
Slice [T]
Tuple(Vec<Ty>)
Tuple
FnPtr
Function pointer
Named
Named type (struct, enum)
Generic
Generic type instantiation (e.g., Vec
TypeParam
Type parameter reference (e.g., T in fn foo
Unit
Unit ()
Never
Never !
TraitObject
Trait object type (dyn Trait)
Task
Task handle - represents a spawned task that will produce a value
TaskGroup
Task group handle - for structured concurrency
Channel
Channel - bidirectional communication channel
Sender
Channel sender half
Receiver
Channel receiver half
Closure
Closure type (id, params, return, captures)
Union
Union type: i64 | f64 | String — tagged discriminated union
NDArray
Owned N-dimensional array: NDArray[T; N] — heap-allocated contiguous data
NDView
Borrowed N-dimensional view: NDView[T; N] — zero-copy slice into an NDArray
CowArray
Copy-on-write array: CowArray[T; N] — shared data, cloned on mutation
DynArray
Dynamic-rank array: DynArray[T] — rank determined at runtime
SmallVec
Small vector with inline storage: SmallVec[T; N]
Simd
SIMD vector type: Simd[T; N]
Implementations§
Trait Implementations§
impl Eq for Ty
impl StructuralPartialEq for Ty
Auto Trait Implementations§
impl Freeze for Ty
impl RefUnwindSafe for Ty
impl Send for Ty
impl Sync for Ty
impl Unpin for Ty
impl UnwindSafe for Ty
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.