Struct rustc_mir::transform::promote_consts::Promoter[−][src]

struct Promoter<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    source: &'a mut Body<'tcx>,
    promoted: Body<'tcx>,
    temps: &'a mut IndexVec<Local, TempState>,
    extra_statements: &'a mut Vec<(Location, Statement<'tcx>)>,
    keep_original: bool,
}

Fields

tcx: TyCtxt<'tcx>source: &'a mut Body<'tcx>promoted: Body<'tcx>temps: &'a mut IndexVec<Local, TempState>extra_statements: &'a mut Vec<(Location, Statement<'tcx>)>keep_original: bool

If true, all nested temps are also kept in the source MIR, not moved to the promoted MIR.

Implementations

impl<'a, 'tcx> Promoter<'a, 'tcx>[src]

fn new_block(&mut self) -> BasicBlock[src]

fn assign(&mut self, dest: Local, rvalue: Rvalue<'tcx>, span: Span)[src]

fn is_temp_kind(&self, local: Local) -> bool[src]

fn promote_temp(&mut self, temp: Local) -> Local[src]

Copies the initialization of this temp to the promoted MIR, recursing through temps.

fn promote_candidate(
    self,
    candidate: Candidate,
    next_promoted_id: usize
) -> Option<Body<'tcx>>
[src]

Trait Implementations

impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx>[src]

Replaces all temporaries with their promoted counterparts.

Auto Trait Implementations

impl<'a, 'tcx> !RefUnwindSafe for Promoter<'a, 'tcx>

impl<'a, 'tcx> !Send for Promoter<'a, 'tcx>

impl<'a, 'tcx> !Sync for Promoter<'a, 'tcx>

impl<'a, 'tcx> Unpin for Promoter<'a, 'tcx> where
    'tcx: 'a, 

impl<'a, 'tcx> !UnwindSafe for Promoter<'a, 'tcx>

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, 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]