[−][src]Struct rustc_mir::borrow_check::type_check::liveness::trace::LivenessResults

pub(in borrow_check::type_check::liveness::trace) struct LivenessResults<'me, 'typeck, 'flow, 'tcx> {
    cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,
    defs: HybridBitSet<PointIndex>,
    use_live_at: HybridBitSet<PointIndex>,
    drop_live_at: HybridBitSet<PointIndex>,
    drop_locations: Vec<Location>,
    stack: Vec<PointIndex>,
}

Fields

cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>defs: HybridBitSet<PointIndex>

Set of points that define the current local.

use_live_at: HybridBitSet<PointIndex>

Points where the current variable is "use live" -- meaning that there is a future "full use" that may use its value.

drop_live_at: HybridBitSet<PointIndex>

Points where the current variable is "drop live" -- meaning that there is no future "full use" that may use its value, but there is a future drop.

drop_locations: Vec<Location>

Locations where drops may occur.

stack: Vec<PointIndex>

Stack used when doing (reverse) DFS.

Implementations

impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx>[src]

pub(in borrow_check::type_check::liveness::trace) fn new(
    cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>
) -> Self
[src]

pub(in borrow_check::type_check::liveness::trace) fn compute_for_all_locals(
    &mut self,
    live_locals: Vec<Local>
)
[src]

pub(in borrow_check::type_check::liveness::trace) fn add_extra_drop_facts(
    &mut self,
    drop_used: Vec<(Local, Location)>,
    live_locals: FxHashSet<Local>
)
[src]

Add extra drop facts needed for Polonius.

Add facts for all locals with free regions, since regions may outlive the function body only at certain nodes in the CFG.

pub(in borrow_check::type_check::liveness::trace) fn reset_local_state(
    &mut self
)
[src]

Clear the value of fields that are "per local variable".

pub(in borrow_check::type_check::liveness::trace) fn add_defs_for(
    &mut self,
    local: Local
)
[src]

Adds the definitions of local into self.defs.

pub(in borrow_check::type_check::liveness::trace) fn compute_use_live_points_for(
    &mut self,
    local: Local
)
[src]

Computes all points where local is "use live" -- meaning its current value may be used later (except by a drop). This is done by walking backwards from each use of local until we find a def of local.

Requires add_defs_for(local) to have been executed.

pub(in borrow_check::type_check::liveness::trace) fn compute_drop_live_points_for(
    &mut self,
    local: Local
)
[src]

Computes all points where local is "drop live" -- meaning its current value may be dropped later (but not used). This is done by iterating over the drops of local where local (or some subpart of local) is initialized. For each such drop, we walk backwards until we find a point where local is either defined or use-live.

Requires compute_use_live_points_for and add_defs_for to have been executed.

pub(in borrow_check::type_check::liveness::trace) fn compute_drop_live_points_for_block(
    &mut self,
    mpi: MovePathIndex,
    term_point: PointIndex
)
[src]

Executes one iteration of the drop-live analysis loop.

The parameter mpi is the MovePathIndex of the local variable we are currently analyzing.

The point term_point represents some terminator in the MIR, where the local mpi is drop-live on entry to that terminator.

This method adds all drop-live points within the block and -- where applicable -- pushes the terminators of preceding blocks onto self.stack.

Auto Trait Implementations

impl<'me, 'typeck, 'flow, 'tcx> !RefUnwindSafe for LivenessResults<'me, 'typeck, 'flow, 'tcx>

impl<'me, 'typeck, 'flow, 'tcx> !Send for LivenessResults<'me, 'typeck, 'flow, 'tcx>

impl<'me, 'typeck, 'flow, 'tcx> !Sync for LivenessResults<'me, 'typeck, 'flow, 'tcx>

impl<'me, 'typeck, 'flow, 'tcx> Unpin for LivenessResults<'me, 'typeck, 'flow, 'tcx> where
    'flow: 'me,
    'tcx: 'me,
    'typeck: 'me, 

impl<'me, 'typeck, 'flow, 'tcx> !UnwindSafe for LivenessResults<'me, 'typeck, 'flow, '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]