pub struct SwitchTargets {
    values: SmallVec<[u128; 1]>,
    targets: SmallVec<[BasicBlock; 2]>,
}

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.

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).

Finds the BasicBlock to which this SwitchInt will branch given the specific value. This cannot fail, as it’ll return the otherwise branch if there’s not a specific match for the value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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 DepNodes 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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