Enum rustc::mir::TerminatorKind
[−]
[src]
pub enum TerminatorKind<'tcx> { Goto { target: BasicBlock, }, SwitchInt { discr: Operand<'tcx>, switch_ty: Ty<'tcx>, values: Cow<'tcx, [u128]>, targets: Vec<BasicBlock>, }, Resume, Abort, 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>, }, FalseUnwind { real_target: BasicBlock, unwind: Option<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, [u128]> | 🔬 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.
Abort
🔬 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 that the process should abort. Used to prevent unwinding for foreign items.
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 P
occurs even if the destructor for
place unwinds. Its semantics are best explained by by the
elaboration:
BB0 { DropAndReplace(P <- V, goto BB1, unwind BB2) }
becomes
BB0 { Drop(P, goto BB1, unwind BB2) } BB1 { // P is now unitialized P <- V } BB2 { // P is now unitialized -- its dtor panicked P <- V }
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?
A block where control flow only ever takes one real path, but borrowck needs to be more conservative.
Fields of FalseEdges
real_target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
imaginary_targets: Vec<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
FalseUnwind
🔬 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 terminator for blocks that only take one path in reality, but where we reserve the right to unwind in borrowck, even if it won't happen in practice. This can arise in infinite loops with no function calls for example.
Fields of FalseUnwind
real_target: BasicBlock | 🔬 This is a nightly-only experimental API. ( |
unwind: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( |
Methods
impl<'tcx> TerminatorKind<'tcx>
[src]
impl<'tcx> TerminatorKind<'tcx>
pub fn if_<'a, 'gcx>(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
cond: Operand<'tcx>,
t: BasicBlock,
f: BasicBlock
) -> TerminatorKind<'tcx>
[src]
pub fn if_<'a, 'gcx>(
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]
pub fn successors(&self) -> Cow<[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?
pub fn successors_mut(&mut self) -> Vec<&mut BasicBlock>
[src]
pub fn successors_mut(&mut self) -> Vec<&mut 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?
pub fn unwind_mut(&mut self) -> Option<&mut Option<BasicBlock>>
[src]
pub fn unwind_mut(&mut self) -> Option<&mut Option<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?
impl<'tcx> TerminatorKind<'tcx>
[src]
impl<'tcx> TerminatorKind<'tcx>
pub fn fmt_head<W: Write>(&self, fmt: &mut W) -> Result
[src]
pub fn fmt_head<W: Write>(&self, fmt: &mut W) -> Result
🔬 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]
pub fn fmt_successor_labels(&self) -> Vec<Cow<'static, str>>
🔬 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<'a, 'gcx> HashStable<StableHashingContext<'a>> for TerminatorKind<'gcx>
[src]
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TerminatorKind<'gcx>
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
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]
impl<'tcx> Clone for TerminatorKind<'tcx>
fn clone(&self) -> TerminatorKind<'tcx>
[src]
fn clone(&self) -> TerminatorKind<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'tcx> Encodable for TerminatorKind<'tcx>
[src]
impl<'tcx> Encodable for TerminatorKind<'tcx>
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::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?
impl<'tcx> Decodable for TerminatorKind<'tcx>
[src]
impl<'tcx> Decodable for TerminatorKind<'tcx>
fn decode<__D: Decoder>(
__arg_0: &mut __D
) -> Result<TerminatorKind<'tcx>, __D::Error>
[src]
fn decode<__D: Decoder>(
__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?
impl<'tcx> Debug for TerminatorKind<'tcx>
[src]
impl<'tcx> Debug for TerminatorKind<'tcx>
Auto Trait Implementations
impl<'tcx> !Send for TerminatorKind<'tcx>
impl<'tcx> !Send for TerminatorKind<'tcx>
impl<'tcx> !Sync for TerminatorKind<'tcx>
impl<'tcx> !Sync for TerminatorKind<'tcx>