BackwardSlicer

Struct BackwardSlicer 

Source
pub struct BackwardSlicer<'tcx> {
    tcx: TyCtxt<'tcx>,
}
Expand description

Entry point for backward path visiting.

Fields§

§tcx: TyCtxt<'tcx>

Implementations§

Source§

impl<'tcx> BackwardSlicer<'tcx>

Source

pub fn new(tcx: TyCtxt<'tcx>) -> Self

Create a backward visitor over the current compiler type context.

Source

pub fn tcx(&self) -> TyCtxt<'tcx>

Return the compiler type context owned by this visitor.

Source

pub fn visit_path_tree( &self, tree: &PathTree, target_block: usize, checkpoint: &Checkpoint<'tcx>, property: &Property<'tcx>, ) -> Vec<RelevantMirItems<'tcx>>

Visit a path tree in post-order, sharing backward analysis across common prefixes. Merges child-relevance sets at branch nodes (the union is a sound over-approximation). Returns per-leaf results.

Callee parameter roots are bound at checkpoint nodes.

Source

pub fn visit_path_tree_for_checkpoint( &self, tree: &PathTree, target_block: usize, caller: DefId, checkpoint_loc: CheckpointLocation, property: &Property<'tcx>, ) -> Vec<RelevantMirItems<'tcx>>

Like [visit_path_tree] but without callee-root binding (used for struct-invariant checks where property places are already in the caller’s local namespace).

Source

fn visit_path_tree_impl( &self, tree: &PathTree, target_block: usize, caller: DefId, checkpoint_block: BasicBlock, bind_checkpoint: Option<&Checkpoint<'tcx>>, property: &Property<'tcx>, ) -> Vec<RelevantMirItems<'tcx>>

Internal: post-order recursion returning per-leaf (block_path, backward_items).

Source

fn build_leaf_items( visitor: &Self, node: &PathNode, target_block: usize, checkpoint_block: BasicBlock, bind_checkpoint: Option<&Checkpoint<'tcx>>, property: &Property<'tcx>, body: &'tcx Body<'tcx>, flow: &DataflowGraph, keep_alloc: bool, ) -> Vec<(Vec<usize>, Vec<BackwardItem<'tcx>>, RelevantPlaces)>

Post-order recursion: returns one (block_path, backward_items, relevant_before_block) per checkpoint leaf. Each leaf is independent — no merging, no HashMap collision.

Source

fn visit_statement( &self, block: BasicBlock, statement_index: usize, statement: &'tcx Statement<'tcx>, flow: &DataflowGraph, relevant: &mut RelevantPlaces, items: &mut Vec<BackwardItem<'tcx>>, keep_allocation_invalidations: bool, )

Visit one MIR statement against the current relevance frontier.

Source

fn visit_terminator( &self, block: BasicBlock, terminator: &Terminator<'tcx>, flow: &DataflowGraph, body: &Body<'tcx>, relevant: &mut RelevantPlaces, items: &mut Vec<BackwardItem<'tcx>>, keep_allocation_invalidations: bool, )

Visit one MIR terminator against the current relevance frontier.

Auto Trait Implementations§

§

impl<'tcx> Freeze for BackwardSlicer<'tcx>

§

impl<'tcx> !RefUnwindSafe for BackwardSlicer<'tcx>

§

impl<'tcx> !Send for BackwardSlicer<'tcx>

§

impl<'tcx> !Sync for BackwardSlicer<'tcx>

§

impl<'tcx> Unpin for BackwardSlicer<'tcx>

§

impl<'tcx> !UnwindSafe for BackwardSlicer<'tcx>

Blanket Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

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

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,