pub enum MirTerminator {
Jump {
target: MirBlockId,
args: Vec<MirLocalId>,
},
Branch {
cond: MirLocalId,
then_target: MirBlockId,
then_args: Vec<MirLocalId>,
else_target: MirBlockId,
else_args: Vec<MirLocalId>,
},
Return {
value: MirLocalId,
},
}Expand description
Block terminator defining control-flow edges.
Variants§
Jump
Unconditional jump to target with block argument values.
Fields
§
target: MirBlockIdBlock id to jump to.
§
args: Vec<MirLocalId>Block arguments passed to the target.
Branch
Conditional branch with explicit then/else targets and arguments.
Fields
§
cond: MirLocalIdLocal id holding the branch condition.
§
then_target: MirBlockIdTarget block when the condition is true.
§
then_args: Vec<MirLocalId>Block arguments passed to the then target.
§
else_target: MirBlockIdTarget block when the condition is false.
§
else_args: Vec<MirLocalId>Block arguments passed to the else target.
Return
Return from current function with value local. Structured return used during CFG construction.
Fields
§
value: MirLocalIdLocal id returned from the function.
Trait Implementations§
Source§impl Clone for MirTerminator
impl Clone for MirTerminator
Source§fn clone(&self) -> MirTerminator
fn clone(&self) -> MirTerminator
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MirTerminator
impl RefUnwindSafe for MirTerminator
impl Send for MirTerminator
impl Sync for MirTerminator
impl Unpin for MirTerminator
impl UnwindSafe for MirTerminator
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