struct LivenessResults<'me, 'typeck, 'flow, 'tcx> {
    cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,
    defs: BitSet<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: BitSet<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> !DynSend for LivenessResults<'me, 'typeck, 'flow, 'tcx>

§

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

§

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

§

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> Aligned for T

source§

const ALIGN: Alignment = _

Alignment of Self.
source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T, R> CollectAndApply<T, R> for T

source§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

§

type Output = R

source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where 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<P> IntoQueryParam<P> for P

source§

impl<T> MaybeResult<T> for T

§

type Error = !

source§

fn from(_: Result<T, <T as MaybeResult<T>>::Error>) -> T

source§

fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<'tcx, T> ToPredicate<'tcx, T> for T

source§

fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T

source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<Tcx, T> Value<Tcx> for T
where Tcx: DepContext,

source§

default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

source§

impl<T> ErasedDestructor for T
where T: 'static,

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