pub struct Variable(/* private fields */);Expand description
A mutable local variable of the builder’s SSA construction
(Builder::declare_var): a name for “the
current value of x” that the builder turns into SSA values and block
parameters. Scoped to one builder. In messages it prints as var<n>.
§Examples
use ir_lang::Variable;
let h = Variable::from_u32(3);
assert_eq!(h.index(), 3);
assert_eq!(h.to_string(), "var3");Implementations§
Source§impl Variable
impl Variable
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::Variable;
assert_eq!(Variable::from_u32(0).index(), 0);Trait Implementations§
impl Copy for Variable
impl Eq for Variable
Source§impl Ord for Variable
impl Ord for Variable
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 Variable
impl PartialOrd for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnsafeUnpin for Variable
impl UnwindSafe for Variable
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