struct LivenessResults<'a, 'typeck, 'b, 'tcx> {
cx: LivenessContext<'a, 'typeck, 'b, 'tcx>,
defs: BitSet<PointIndex>,
use_live_at: IntervalSet<PointIndex>,
drop_live_at: IntervalSet<PointIndex>,
drop_locations: Vec<Location>,
stack: Vec<PointIndex>,
}
Fields§
§cx: LivenessContext<'a, 'typeck, 'b, '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<'a, 'typeck, 'b, 'tcx> LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> LivenessResults<'a, 'typeck, 'b, 'tcx>
fn new(cx: LivenessContext<'a, 'typeck, 'b, 'tcx>) -> Self
fn compute_for_all_locals(&mut self, relevant_live_locals: Vec<Local>)
Sourcefn dropck_boring_locals(&mut self, boring_locals: Vec<Local>)
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.
Sourcefn add_extra_drop_facts(&mut self, relevant_live_locals: &[Local]) -> Option<()>
fn add_extra_drop_facts(&mut self, relevant_live_locals: &[Local]) -> Option<()>
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.
Sourcefn reset_local_state(&mut self)
fn reset_local_state(&mut self)
Clear the value of fields that are “per local variable”.
Sourcefn add_defs_for(&mut self, local: Local)
fn add_defs_for(&mut self, local: Local)
Adds the definitions of local
into self.defs
.
Sourcefn compute_use_live_points_for(&mut self, local: Local)
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.
Sourcefn compute_drop_live_points_for(&mut self, local: Local)
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.
Sourcefn compute_drop_live_points_for_block(
&mut self,
mpi: MovePathIndex,
term_point: PointIndex,
)
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<'a, 'typeck, 'b, 'tcx> !DynSend for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> !DynSync for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> Freeze for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> !RefUnwindSafe for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> !Send for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> !Sync for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> Unpin for LivenessResults<'a, 'typeck, 'b, 'tcx>
impl<'a, 'typeck, 'b, 'tcx> !UnwindSafe for LivenessResults<'a, 'typeck, 'b, 'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
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: 360 bytes