pub struct Imm(/* private fields */);Expand description
A constant, in the immediate table.
The bits and nothing else. An integer is stored two’s complement in as many of the low bits as its type is wide, and a floating point value is stored as its bit pattern, so the same table holds both and the type on the result says how to read it. That keeps a bit-preserving answer for a NaN payload, which a value of a Rust floating type would not.
Implementations§
Source§impl Imm
impl Imm
Sourcepub fn int(value: i128, ty: Type) -> Self
pub fn int(value: i128, ty: Type) -> Self
An integer, with the bits above ty cleared.
A value is stored in exactly the width its type has, so two immediates are equal when they are the same value, which is what lets an equality on the table stand in for an equality on the numbers.
§Panics
Panics if ty is not an integer type.
Trait Implementations§
impl Copy for Imm
impl Eq for Imm
impl StructuralPartialEq for Imm
Auto Trait Implementations§
impl Freeze for Imm
impl RefUnwindSafe for Imm
impl Send for Imm
impl Sync for Imm
impl Unpin for Imm
impl UnsafeUnpin for Imm
impl UnwindSafe for Imm
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