[−][src]Struct rustc_mir::transform::elaborate_drops::ElaborateDropsCtxt

pub(in transform::elaborate_drops) struct ElaborateDropsCtxt<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    body: &'a Body<'tcx>,
    env: &'a MoveDataParamEnv<'tcx>,
    init_data: InitializationData<'a, 'tcx>,
    drop_flags: FxHashMap<MovePathIndex, Local>,
    patch: MirPatch<'tcx>,
}

Fields

tcx: TyCtxt<'tcx>body: &'a Body<'tcx>env: &'a MoveDataParamEnv<'tcx>init_data: InitializationData<'a, 'tcx>drop_flags: FxHashMap<MovePathIndex, Local>patch: MirPatch<'tcx>

Implementations

impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx>[src]

pub(in transform::elaborate_drops) fn move_data(
    &self
) -> &'b MoveData<'tcx>
[src]

pub(in transform::elaborate_drops) fn param_env(
    &self
) -> ParamEnv<'tcx>
[src]

pub(in transform::elaborate_drops) fn create_drop_flag(
    &mut self,
    index: MovePathIndex,
    span: Span
)
[src]

pub(in transform::elaborate_drops) fn drop_flag(
    &mut self,
    index: MovePathIndex
) -> Option<Place<'tcx>>
[src]

pub(in transform::elaborate_drops) fn elaborate(
    self
) -> MirPatch<'tcx>
[src]

create a patch that elaborates all drops in the input MIR.

pub(in transform::elaborate_drops) fn collect_drop_flags(
    &mut self
)
[src]

pub(in transform::elaborate_drops) fn elaborate_drops(
    &mut self
)
[src]

pub(in transform::elaborate_drops) fn elaborate_replace(
    &mut self,
    loc: Location,
    place: Place<'tcx>,
    value: &Operand<'tcx>,
    target: BasicBlock,
    unwind: Option<BasicBlock>
)
[src]

Elaborate a MIR replace terminator. This instruction is not directly handled by codegen, and therefore must be desugared.

The desugaring drops the location if needed, and then writes the value (including setting the drop flag) over it in both arms.

The replace terminator can also be called on places that are not tracked by elaboration (for example, replace x[i] <- tmp0). The borrow checker requires that these locations are initialized before the assignment, so we just generate an unconditional drop.

pub(in transform::elaborate_drops) fn constant_bool(
    &self,
    span: Span,
    val: bool
) -> Rvalue<'tcx>
[src]

pub(in transform::elaborate_drops) fn set_drop_flag(
    &mut self,
    loc: Location,
    path: MovePathIndex,
    val: DropFlagState
)
[src]

pub(in transform::elaborate_drops) fn drop_flags_on_init(
    &mut self
)
[src]

pub(in transform::elaborate_drops) fn drop_flags_for_fn_rets(
    &mut self
)
[src]

pub(in transform::elaborate_drops) fn drop_flags_for_args(
    &mut self
)
[src]

pub(in transform::elaborate_drops) fn drop_flags_for_locs(
    &mut self
)
[src]

Auto Trait Implementations

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

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

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

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

impl<'a, 'tcx> !UnwindSafe for ElaborateDropsCtxt<'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]