struct LivenessResults<'me, 'typeck, 'flow, 'tcx> {
    cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,
    defs: HybridBitSet<PointIndex>,
    use_live_at: IntervalSet<PointIndex>,
    drop_live_at: IntervalSet<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: IntervalSet<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: IntervalSet<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§

source§

impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx>

source

fn new(cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>) -> Self

source

fn compute_for_all_locals(&mut self, relevant_live_locals: Vec<Local>)

source

fn dropck_boring_locals(&mut self, boring_locals: Vec<Local>)

Runs dropck for locals whose liveness isn’t relevant. This is necessary to eagerly detect unbound recursion during drop glue computation.

These are all the locals which do not potentially reference a region local to this body. Locals which only reference free regions are always drop-live and can therefore safely be dropped.

source

fn add_extra_drop_facts( &mut self, drop_used: Vec<(Local, Location)>, relevant_live_locals: FxIndexSet<Local> )

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.

source

fn reset_local_state(&mut self)

Clear the value of fields that are “per local variable”.

source

fn add_defs_for(&mut self, local: Local)

Adds the definitions of local into self.defs.

source

fn compute_use_live_points_for(&mut self, local: Local)

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.

source

fn compute_drop_live_points_for(&mut self, local: Local)

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.

source

fn compute_drop_live_points_for_block( &mut self, mpi: MovePathIndex, term_point: PointIndex )

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>

§

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

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::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: 336 bytes