Enum stable_mir::abi::Primitive
source · pub enum Primitive {
Int {
length: IntegerLength,
signed: bool,
},
Float {
length: FloatLength,
},
Pointer(AddressSpace),
}
Expand description
Fundamental unit of memory access and layout.
Variants§
Int
The bool
is the signedness of the Integer
type.
One would think we would not care about such details this low down, but some ABIs are described in terms of C types and ISAs where the integer arithmetic is done on {sign,zero}-extended registers, e.g. a negative integer passed by zero-extension will appear positive in the callee, and most operations on it will produce the wrong values.
Float
Fields
§
length: FloatLength
Pointer(AddressSpace)
Implementations§
Trait Implementations§
source§impl PartialEq for Primitive
impl PartialEq for Primitive
impl Copy for Primitive
impl Eq for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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
Mutably borrows from an owned value. Read more
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: 8 bytes
Size for each variant:
Int
: 2 bytesFloat
: 1 bytePointer
: 7 bytes