Enum rustc::mir::TerminatorKind
[−]
[src]
pub enum TerminatorKind<'tcx> { Goto { target: BasicBlock, }, SwitchInt { discr: Operand<'tcx>, switch_ty: Ty<'tcx>, values: Cow<'tcx, [ConstInt]>, targets: Vec<BasicBlock>, }, Resume, Return, Unreachable, Drop { location: Place<'tcx>, target: BasicBlock, unwind: Option<BasicBlock>, }, DropAndReplace { location: Place<'tcx>, value: Operand<'tcx>, target: BasicBlock, unwind: Option<BasicBlock>, }, Call { func: Operand<'tcx>, args: Vec<Operand<'tcx>>, destination: Option<(Place<'tcx>, BasicBlock)>, cleanup: Option<BasicBlock>, }, Assert { cond: Operand<'tcx>, expected: bool, msg: AssertMessage<'tcx>, target: BasicBlock, cleanup: Option<BasicBlock>, }, Yield { value: Operand<'tcx>, resume: BasicBlock, drop: Option<BasicBlock>, }, GeneratorDrop, FalseEdges { real_target: BasicBlock, imaginary_targets: Vec<BasicBlock>, }, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Variants
Goto
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
block should have one successor in the graph; we jump there
Fields of Goto
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
SwitchInt
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
operand evaluates to an integer; jump depending on its value
to one of the targets, and otherwise fallback to otherwise
Fields of SwitchInt
discr: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( |
switch_ty: Ty<'tcx> | 🔬 This is a nightly-only experimental API. ( |
values: Cow<'tcx, [ConstInt]> | 🔬 This is a nightly-only experimental API. ( |
targets: Vec<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
Resume
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates that the landing pad is finished and unwinding should continue. Emitted by build::scope::diverge_cleanup.
Return
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates a normal return. The return place should have been filled in by now. This should occur at most once.
Unreachable
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates a terminator that can never be reached.
Drop
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Drop the Place
Fields of Drop
location: Place<'tcx> | 🔬 This is a nightly-only experimental API. ( |
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
unwind: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
DropAndReplace
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Drop the Place and assign the new value over it. This ensures that the assignment to LV occurs even if the destructor for place unwinds. Its semantics are best explained by by the elaboration:
BB0 { DropAndReplace(LV <- RV, goto BB1, unwind BB2) }
becomes
BB0 { Drop(LV, goto BB1, unwind BB2) } BB1 { // LV is now unitialized LV <- RV } BB2 { // LV is now unitialized -- its dtor panicked LV <- RV }
Fields of DropAndReplace
location: Place<'tcx> | 🔬 This is a nightly-only experimental API. ( |
value: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( |
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
unwind: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
Call
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Block ends with a call of a converging function
Fields of Call
func: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( |
args: Vec<Operand<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
destination: Option<(Place<'tcx>, BasicBlock)> | 🔬 This is a nightly-only experimental API. ( |
cleanup: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
Assert
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Jump to the target if the condition has the expected value, otherwise panic with a message and a cleanup target.
Fields of Assert
cond: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( |
expected: bool | 🔬 This is a nightly-only experimental API. ( |
msg: AssertMessage<'tcx> | 🔬 This is a nightly-only experimental API. ( |
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
cleanup: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
Yield
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A suspend point
Fields of Yield
value: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( |
resume: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
drop: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
GeneratorDrop
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates the end of the dropping of a generator
FalseEdges
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of FalseEdges
real_target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
imaginary_targets: Vec<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
Methods
impl<'tcx> TerminatorKind<'tcx>
[src]
pub fn if_<'a, 'gcx>(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
cond: Operand<'tcx>,
t: BasicBlock,
f: BasicBlock
) -> TerminatorKind<'tcx>
[src]
tcx: TyCtxt<'a, 'gcx, 'tcx>,
cond: Operand<'tcx>,
t: BasicBlock,
f: BasicBlock
) -> TerminatorKind<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn successors(&self) -> Cow<[BasicBlock]>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn successors_mut(&mut self) -> Vec<&mut BasicBlock>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn unwind_mut(&mut self) -> Option<&mut Option<BasicBlock>>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx> TerminatorKind<'tcx>
[src]
pub fn fmt_head<W: Write>(&self, fmt: &mut W) -> Result
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Write the "head" part of the terminator; that is, its name and the data it uses to pick the successor basic block, if any. The only information not included is the list of possible successors, which may be rendered differently between the text and the graphviz format.
pub fn fmt_successor_labels(&self) -> Vec<Cow<'static, str>>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Return the list of labels for the edges to the successor basic blocks.
Trait Implementations
impl<'gcx> HashStable<StableHashingContext<'gcx>> for TerminatorKind<'gcx>
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
[src]
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx> Clone for TerminatorKind<'tcx>
[src]
fn clone(&self) -> TerminatorKind<'tcx>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'tcx> Encodable for TerminatorKind<'tcx>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx> Decodable for TerminatorKind<'tcx>
[src]
fn decode<__D: Decoder>(
__arg_0: &mut __D
) -> Result<TerminatorKind<'tcx>, __D::Error>
[src]
__arg_0: &mut __D
) -> Result<TerminatorKind<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?