Struct rustc_middle::mir::terminator::SwitchTargets [−][src]
Fields
values: SmallVec<[u128; 1]>
Possible values. The locations to branch to in each case
are found in the corresponding indices from the targets
vector.
targets: SmallVec<[BasicBlock; 2]>
Possible branch sites. The last element of this vector is used for the otherwise branch, so targets.len() == values.len() + 1 should hold.
Implementations
Creates switch targets from an iterator of values and target blocks.
The iterator may be empty, in which case the SwitchInt
instruction is equivalent to
goto otherwise;
.
Builds a switch targets definition that jumps to then
if the tested value equals value
,
and to else_
if not.
Returns the fallback target that is jumped to when none of the values match the operand.
pub fn iter(&self) -> SwitchTargetsIter<'_>ⓘNotable traits for SwitchTargetsIter<'a>impl<'a> Iterator for SwitchTargetsIter<'a> type Item = (u128, BasicBlock);
pub fn iter(&self) -> SwitchTargetsIter<'_>ⓘNotable traits for SwitchTargetsIter<'a>impl<'a> Iterator for SwitchTargetsIter<'a> type Item = (u128, BasicBlock);
impl<'a> Iterator for SwitchTargetsIter<'a> type Item = (u128, BasicBlock);
Returns an iterator over the switch targets.
The iterator will yield tuples containing the value and corresponding target to jump to, not
including the otherwise
fallback target.
Note that this may yield 0 elements. Only the otherwise
branch is mandatory.
Returns a slice with all possible jump targets (including the fallback target).
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for SwitchTargets
impl Send for SwitchTargets
impl Sync for SwitchTargets
impl Unpin for SwitchTargets
impl UnwindSafe for SwitchTargets
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
This method tries to recover the query key from the given DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes