[−][src]Enum rustc_mir::transform::promote_consts::Candidate

pub enum Candidate {
    Ref(Location),
    Repeat(Location),
    Argument {
        bb: BasicBlock,
        index: usize,
    },
    InlineAsm {
        bb: BasicBlock,
        index: usize,
    },
}

A "root candidate" for promotion, which will become the returned value in a promoted MIR, unless it's a subset of a larger candidate.

Variants

Ref(Location)

Borrow of a constant temporary, candidate for lifetime extension.

Repeat(Location)

Promotion of the x in [x; 32].

Argument

Currently applied to function calls where the callee has the unstable #[rustc_args_required_const] attribute as well as the SIMD shuffle intrinsic. The intrinsic requires the arguments are indeed constant and the attribute currently provides the semantic requirement that arguments must be constant.

Fields of Argument

bb: BasicBlockindex: usize
InlineAsm

const operand in asm!.

Fields of InlineAsm

bb: BasicBlockindex: usize

Implementations

impl Candidate[src]

pub(in transform::promote_consts) fn forces_explicit_promotion(
    &self
) -> bool
[src]

Returns true if we should use the "explicit" rules for promotability for this Candidate.

pub(in transform::promote_consts) fn source_info(
    &self,
    body: &Body<'_>
) -> SourceInfo
[src]

Trait Implementations

impl Clone for Candidate[src]

impl Copy for Candidate[src]

impl Debug for Candidate[src]

impl Eq for Candidate[src]

impl PartialEq<Candidate> for Candidate[src]

impl StructuralEq for Candidate[src]

impl StructuralPartialEq for Candidate[src]

Auto Trait Implementations

impl RefUnwindSafe for Candidate

impl Send for Candidate

impl Sync for Candidate

impl Unpin for Candidate

impl UnwindSafe for Candidate

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]