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

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.

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

Adds the definitions of local into self.defs.

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.

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.

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion 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: 280 bytes