Struct miri::borrow_tracker::tree_borrows::tree::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.