pub enum Terminator {
Goto {
target: String,
},
SwitchInt {
condition: String,
targets: Vec<(String, String)>,
otherwise: Option<String>,
},
Return,
Call {
return_target: Option<String>,
unwind_target: Option<String>,
},
Assert {
success_target: String,
failure_target: Option<String>,
},
Drop {
target: String,
unwind_target: Option<String>,
},
Unreachable,
Unknown(String),
}Expand description
Terminator instruction that ends a basic block
Variants§
Goto
Unconditional jump: goto -> bb5
SwitchInt
Conditional branch: switchInt(x) -> [0: bb1, otherwise: bb2]
Fields
Return
Function return
Call
Function call with potential branches (return/unwind)
Fields
Assert
Assertion (similar to Call)
Fields
Drop
Drop value (can unwind)
Unreachable
Unreachable code
Unknown(String)
Unknown or unparsed terminator
Trait Implementations§
Source§impl Clone for Terminator
impl Clone for Terminator
Source§fn clone(&self) -> Terminator
fn clone(&self) -> Terminator
Returns a duplicate 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 Terminator
impl RefUnwindSafe for Terminator
impl Send for Terminator
impl Sync for Terminator
impl Unpin for Terminator
impl UnsafeUnpin for Terminator
impl UnwindSafe for Terminator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more