struct LocalsUsageVisitor {
used_locals: Vector<LocalId, bool>,
}
Fields§
§used_locals: Vector<LocalId, bool>
Trait Implementations§
Source§impl VisitBody for LocalsUsageVisitor
impl VisitBody for LocalsUsageVisitor
Source§fn enter_local_id(&mut self, lid: &LocalId)
fn enter_local_id(&mut self, lid: &LocalId)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn visit_llbc_statement(&mut self, st: &Statement) -> ControlFlow<Self::Break>
fn visit_llbc_statement(&mut self, st: &Statement) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn visit_ullbc_statement(&mut self, st: &Statement) -> ControlFlow<Self::Break>
fn visit_ullbc_statement(&mut self, st: &Statement) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn visit<'a, T: BodyVisitable>(&'a mut self, x: &T) -> ControlFlow<Self::Break>
fn visit<'a, T: BodyVisitable>(&'a mut self, x: &T) -> ControlFlow<Self::Break>
Visit a visitable type. This calls the appropriate method of this trait on
x
(visit_$ty
if it exists, visit_inner
if not).Source§fn visit_by_val<T: BodyVisitable>(self, x: &T) -> ControlFlow<Self::Break, Self>
fn visit_by_val<T: BodyVisitable>(self, x: &T) -> ControlFlow<Self::Break, Self>
Convenience alias for method chaining.
Source§fn visit_by_val_infallible<T: BodyVisitable>(self, x: &T) -> Selfwhere
Self: Visitor<Break = Infallible> + Sized,
fn visit_by_val_infallible<T: BodyVisitable>(self, x: &T) -> Selfwhere
Self: Visitor<Break = Infallible> + Sized,
Convenience when the visitor does not return early.
Source§fn visit_inner<T>(&mut self, x: &T) -> ControlFlow<Self::Break>where
T: BodyVisitable + for<'s> Drive<'s, BodyVisitableWrapper<Self>>,
fn visit_inner<T>(&mut self, x: &T) -> ControlFlow<Self::Break>where
T: BodyVisitable + for<'s> Drive<'s, BodyVisitableWrapper<Self>>,
Visit the contents of
x
. This calls self.visit()
on each field of T
. This
is available for any type whose contents are all #trait_name
.Source§fn visit_aggregate_kind(
&mut self,
x: &AggregateKind,
) -> ControlFlow<Self::Break>
fn visit_aggregate_kind( &mut self, x: &AggregateKind, ) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_aggregate_kind(&mut self, x: &AggregateKind)
fn enter_aggregate_kind(&mut self, x: &AggregateKind)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_aggregate_kind(&mut self, x: &AggregateKind)
fn exit_aggregate_kind(&mut self, x: &AggregateKind)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_call(&mut self, x: &Call) -> ControlFlow<Self::Break>
fn visit_call(&mut self, x: &Call) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_call(&mut self, x: &Call)
fn enter_call(&mut self, x: &Call)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_call(&mut self, x: &Call)
fn exit_call(&mut self, x: &Call)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_fn_operand(&mut self, x: &FnOperand) -> ControlFlow<Self::Break>
fn visit_fn_operand(&mut self, x: &FnOperand) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_fn_operand(&mut self, x: &FnOperand)
fn enter_fn_operand(&mut self, x: &FnOperand)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_fn_operand(&mut self, x: &FnOperand)
fn exit_fn_operand(&mut self, x: &FnOperand)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_fn_ptr(&mut self, x: &FnPtr) -> ControlFlow<Self::Break>
fn visit_fn_ptr(&mut self, x: &FnPtr) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_fn_ptr(&mut self, x: &FnPtr)
fn enter_fn_ptr(&mut self, x: &FnPtr)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_fn_ptr(&mut self, x: &FnPtr)
fn exit_fn_ptr(&mut self, x: &FnPtr)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_operand(&mut self, x: &Operand) -> ControlFlow<Self::Break>
fn visit_operand(&mut self, x: &Operand) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_operand(&mut self, x: &Operand)
fn enter_operand(&mut self, x: &Operand)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_operand(&mut self, x: &Operand)
fn exit_operand(&mut self, x: &Operand)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_place(&mut self, x: &Place) -> ControlFlow<Self::Break>
fn visit_place(&mut self, x: &Place) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_place(&mut self, x: &Place)
fn enter_place(&mut self, x: &Place)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_place(&mut self, x: &Place)
fn exit_place(&mut self, x: &Place)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_projection_elem(
&mut self,
x: &ProjectionElem,
) -> ControlFlow<Self::Break>
fn visit_projection_elem( &mut self, x: &ProjectionElem, ) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_projection_elem(&mut self, x: &ProjectionElem)
fn enter_projection_elem(&mut self, x: &ProjectionElem)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_projection_elem(&mut self, x: &ProjectionElem)
fn exit_projection_elem(&mut self, x: &ProjectionElem)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_rvalue(&mut self, x: &Rvalue) -> ControlFlow<Self::Break>
fn visit_rvalue(&mut self, x: &Rvalue) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_rvalue(&mut self, x: &Rvalue)
fn enter_rvalue(&mut self, x: &Rvalue)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_rvalue(&mut self, x: &Rvalue)
fn exit_rvalue(&mut self, x: &Rvalue)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_locals(&mut self, x: &Locals) -> ControlFlow<Self::Break>
fn visit_locals(&mut self, x: &Locals) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_locals(&mut self, x: &Locals)
fn enter_locals(&mut self, x: &Locals)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_locals(&mut self, x: &Locals)
fn exit_locals(&mut self, x: &Locals)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_local_id(&mut self, x: &LocalId) -> ControlFlow<Self::Break>
fn visit_local_id(&mut self, x: &LocalId) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn exit_local_id(&mut self, x: &LocalId)
fn exit_local_id(&mut self, x: &LocalId)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_llbc_block(&mut self, x: &Block) -> ControlFlow<Self::Break>
fn visit_llbc_block(&mut self, x: &Block) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_llbc_block(&mut self, x: &Block)
fn enter_llbc_block(&mut self, x: &Block)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_llbc_block(&mut self, x: &Block)
fn exit_llbc_block(&mut self, x: &Block)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn enter_llbc_statement(&mut self, x: &Statement)
fn enter_llbc_statement(&mut self, x: &Statement)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_llbc_statement(&mut self, x: &Statement)
fn exit_llbc_statement(&mut self, x: &Statement)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn enter_ullbc_statement(&mut self, x: &Statement)
fn enter_ullbc_statement(&mut self, x: &Statement)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_ullbc_statement(&mut self, x: &Statement)
fn exit_ullbc_statement(&mut self, x: &Statement)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_ullbc_terminator(&mut self, x: &Terminator) -> ControlFlow<Self::Break>
fn visit_ullbc_terminator(&mut self, x: &Terminator) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_ullbc_terminator(&mut self, x: &Terminator)
fn enter_ullbc_terminator(&mut self, x: &Terminator)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_ullbc_terminator(&mut self, x: &Terminator)
fn exit_ullbc_terminator(&mut self, x: &Terminator)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§fn visit_ullbc_block_id(&mut self, x: &BlockId) -> ControlFlow<Self::Break>
fn visit_ullbc_block_id(&mut self, x: &BlockId) -> ControlFlow<Self::Break>
Overrideable method called when visiting a
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_ullbc_block_id(&mut self, x: &BlockId)
fn enter_ullbc_block_id(&mut self, x: &BlockId)
Called when starting to visit a
$ty
(unless visit_$ty
is overriden).Source§fn exit_ullbc_block_id(&mut self, x: &BlockId)
fn exit_ullbc_block_id(&mut self, x: &BlockId)
Called when finished visiting a
$ty
(unless visit_$ty
is overriden).Source§impl Visitor for LocalsUsageVisitor
impl Visitor for LocalsUsageVisitor
Source§type Break = Infallible
type Break = Infallible
The type used for early-return, if the visitor supports it. Use an empty type like
std::convert::Infallible
if the visitor does not short-circuit.Auto Trait Implementations§
impl Freeze for LocalsUsageVisitor
impl RefUnwindSafe for LocalsUsageVisitor
impl Send for LocalsUsageVisitor
impl Sync for LocalsUsageVisitor
impl Unpin for LocalsUsageVisitor
impl UnwindSafe for LocalsUsageVisitor
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