pub struct StackSlot(/* private fields */);Expand description
A stack slot of a function: frame memory addressed with
InstData::StackAddr. It prints as ss<n>.
§Examples
use ir_lang::StackSlot;
let h = StackSlot::from_u32(3);
assert_eq!(h.index(), 3);
assert_eq!(h.to_string(), "ss3");Implementations§
Source§impl StackSlot
impl StackSlot
Sourcepub const fn from_u32(index: u32) -> Self
pub const fn from_u32(index: u32) -> Self
Makes a handle from a raw index.
Handles normally come from the module or function that owns the entity. This constructor exists for side tables and tests; a handle made up this way is checked like any other (an out-of-range handle is a validation error, never a panic).
§Examples
use ir_lang::StackSlot;
assert_eq!(StackSlot::from_u32(0).index(), 0);Trait Implementations§
impl Copy for StackSlot
impl Eq for StackSlot
Source§impl Ord for StackSlot
impl Ord for StackSlot
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for StackSlot
impl PartialOrd for StackSlot
impl StructuralPartialEq for StackSlot
Auto Trait Implementations§
impl Freeze for StackSlot
impl RefUnwindSafe for StackSlot
impl Send for StackSlot
impl Sync for StackSlot
impl Unpin for StackSlot
impl UnsafeUnpin for StackSlot
impl UnwindSafe for StackSlot
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