pub struct Block(/* private fields */);Expand description
A basic block in a function. It prints as b<n>.
§Examples
use ir_lang::Block;
let h = Block::from_u32(3);
assert_eq!(h.index(), 3);
assert_eq!(h.to_string(), "b3");Implementations§
Source§impl Block
impl Block
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::Block;
assert_eq!(Block::from_u32(0).index(), 0);Trait Implementations§
impl Copy for Block
impl Eq for Block
Source§impl Ord for Block
impl Ord for Block
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 Block
impl PartialOrd for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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