struct Visitor<'a> {
locals: &'a mut Vector<VarId, Var>,
statements: Vec<Statement>,
place_mutability_stack: Vec<bool>,
span: Span,
}
Expand description
Visitor to transform the operands by introducing intermediate let statements.
We explore the statements without diving into substatements, and in particular explore the places and operands. Places always appear as destinations we are writing to. While we explore the places/operands present in a statement, We temporarily store the new statements inside the visitor. Once we’ve finished exploring the statement, we insert those before the statement.
Fields§
§locals: &'a mut Vector<VarId, Var>
§statements: Vec<Statement>
§place_mutability_stack: Vec<bool>
§span: Span
Implementations§
source§impl<'a> Visitor<'a>
impl<'a> Visitor<'a>
The visitor methods.
fn enter_place(&mut self, p: &mut Place)
fn enter_operand(&mut self, op: &mut Operand)
fn enter_call(&mut self, _c: &mut Call)
fn enter_fn_operand(&mut self, fn_op: &mut FnOperand)
fn enter_rvalue(&mut self, rv: &mut Rvalue)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Visitor<'a>
impl<'a> RefUnwindSafe for Visitor<'a>
impl<'a> Send for Visitor<'a>
impl<'a> Sync for Visitor<'a>
impl<'a> Unpin for Visitor<'a>
impl<'a> !UnwindSafe for Visitor<'a>
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
Mutably borrows from an owned value. Read more
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more