rustc_borrowck::type_check::liveness::trace

Struct LivenessResults

Source
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>

Source

fn new(cx: LivenessContext<'a, 'typeck, 'b, '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, 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.

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<'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> 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<_>>()).

Source§

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<P> IntoQueryParam<P> for P

Source§

impl<T> MaybeResult<T> for T

Source§

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.
Source§

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

Source§

fn upcast(self, interner: I) -> U

Source§

impl<I, T> UpcastFrom<I, T> for T

Source§

fn upcast_from(from: T, _tcx: I) -> T

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: 360 bytes