miri::borrow_tracker::tree_borrows::tree

Struct TreeVisitorStack

Source
struct TreeVisitorStack<NodeContinue, NodeApp, ErrHandler> {
    initial: UniIndex,
    f_continue: NodeContinue,
    f_propagate: NodeApp,
    err_builder: ErrHandler,
    stack: Vec<(UniIndex, AccessRelatedness, RecursionState)>,
}
Expand description

Stack of nodes left to explore in a tree traversal. See the docs of traverse_this_parents_children_other for details on the traversal order.

Fields§

§initial: UniIndex

Identifier of the original access.

§f_continue: NodeContinue

Function describing whether to continue at a tag. This is only invoked for foreign accesses.

§f_propagate: NodeApp

Function to apply to each tag.

§err_builder: ErrHandler

Handler to add the required context to diagnostics.

§stack: Vec<(UniIndex, AccessRelatedness, RecursionState)>

Mutable state of the visit: the tags left to handle. Every tag pushed should eventually be handled, and the precise order is relevant for diagnostics. Since the traversal is piecewise bottom-up, we need to remember whether we’re here initially, or after visiting all children. The last element indicates this. This is just an artifact of how you hand-roll recursion, it does not have a deeper meaning otherwise.

Implementations§

Source§

impl<NodeContinue, NodeApp, InnErr, OutErr, ErrHandler> TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: Fn(&NodeAppArgs<'_>) -> ContinueTraversal, NodeApp: Fn(NodeAppArgs<'_>) -> Result<(), InnErr>, ErrHandler: Fn(ErrHandlerArgs<'_, InnErr>) -> OutErr,

Source

fn should_continue_at( &self, this: &mut TreeVisitor<'_>, idx: UniIndex, rel_pos: AccessRelatedness, ) -> ContinueTraversal

Source

fn propagate_at( &mut self, this: &mut TreeVisitor<'_>, idx: UniIndex, rel_pos: AccessRelatedness, ) -> Result<(), OutErr>

Source

fn go_upwards_from_accessed( &mut self, this: &mut TreeVisitor<'_>, accessed_node: UniIndex, visit_children: ChildrenVisitMode, ) -> Result<(), OutErr>

Source

fn finish_foreign_accesses( &mut self, this: &mut TreeVisitor<'_>, ) -> Result<(), OutErr>

Source

fn new( initial: UniIndex, f_continue: NodeContinue, f_propagate: NodeApp, err_builder: ErrHandler, ) -> Self

Auto Trait Implementations§

§

impl<NodeContinue, NodeApp, ErrHandler> Freeze for TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: Freeze, NodeApp: Freeze, ErrHandler: Freeze,

§

impl<NodeContinue, NodeApp, ErrHandler> RefUnwindSafe for TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: RefUnwindSafe, NodeApp: RefUnwindSafe, ErrHandler: RefUnwindSafe,

§

impl<NodeContinue, NodeApp, ErrHandler> Send for TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: Send, NodeApp: Send, ErrHandler: Send,

§

impl<NodeContinue, NodeApp, ErrHandler> Sync for TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: Sync, NodeApp: Sync, ErrHandler: Sync,

§

impl<NodeContinue, NodeApp, ErrHandler> Unpin for TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: Unpin, NodeApp: Unpin, ErrHandler: Unpin,

§

impl<NodeContinue, NodeApp, ErrHandler> UnwindSafe for TreeVisitorStack<NodeContinue, NodeApp, ErrHandler>
where NodeContinue: UnwindSafe, NodeApp: UnwindSafe, ErrHandler: UnwindSafe,

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

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

§

fn vzip(self) -> V

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.