Struct miri::borrow_tracker::stacked_borrows::RetagVisitor
source · struct RetagVisitor<'ecx, 'mir, 'tcx> {
ecx: &'ecx mut MiriInterpCx<'mir, 'tcx>,
kind: RetagKind,
retag_cause: RetagCause,
retag_fields: RetagFields,
}Fields§
§ecx: &'ecx mut MiriInterpCx<'mir, 'tcx>§kind: RetagKind§retag_cause: RetagCause§retag_fields: RetagFieldsImplementations§
source§impl<'ecx, 'mir, 'tcx> RetagVisitor<'ecx, 'mir, 'tcx>
impl<'ecx, 'mir, 'tcx> RetagVisitor<'ecx, 'mir, 'tcx>
fn retag_ptr_inplace(
&mut self,
place: &PlaceTy<'tcx, Provenance>,
new_perm: NewPermission,
retag_cause: RetagCause
) -> InterpResult<'tcx>
Trait Implementations§
source§impl<'ecx, 'mir, 'tcx> MutValueVisitor<'mir, 'tcx, MiriMachine<'mir, 'tcx>> for RetagVisitor<'ecx, 'mir, 'tcx>
impl<'ecx, 'mir, 'tcx> MutValueVisitor<'mir, 'tcx, MiriMachine<'mir, 'tcx>> for RetagVisitor<'ecx, 'mir, 'tcx>
type V = PlaceTy<'tcx, Provenance>
source§fn ecx(&mut self) -> &mut MiriInterpCx<'mir, 'tcx>
fn ecx(&mut self) -> &mut MiriInterpCx<'mir, 'tcx>
The visitor must have an
InterpCx in it.source§fn visit_box(&mut self, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx>
fn visit_box(&mut self, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx>
Visits the given value as the pointer of a
Box. There is nothing to recurse into.
The type of v will be a raw pointer, but this is a field of Box<T> and the
pointee type is the actual T.source§fn visit_value(
&mut self,
place: &PlaceTy<'tcx, Provenance>
) -> InterpResult<'tcx>
fn visit_value(
&mut self,
place: &PlaceTy<'tcx, Provenance>
) -> InterpResult<'tcx>
Visits the given value, dispatching as appropriate to more specialized visitors.
source§fn read_discriminant(
&mut self,
op: &OpTy<'tcx, <M as Machine<'mir, 'tcx>>::Provenance>
) -> Result<VariantIdx, InterpErrorInfo<'tcx>>
fn read_discriminant(
&mut self,
op: &OpTy<'tcx, <M as Machine<'mir, 'tcx>>::Provenance>
) -> Result<VariantIdx, InterpErrorInfo<'tcx>>
read_discriminant can be hooked for better error messages.source§fn visit_union(
&mut self,
_v: &Self::V,
_fields: NonZeroUsize
) -> Result<(), InterpErrorInfo<'tcx>>
fn visit_union(
&mut self,
_v: &Self::V,
_fields: NonZeroUsize
) -> Result<(), InterpErrorInfo<'tcx>>
Visits the given value as a union. No automatic recursion can happen here.
source§fn visit_aggregate(
&mut self,
v: &Self::V,
fields: impl Iterator<Item = Result<Self::V, InterpErrorInfo<'tcx>>>
) -> Result<(), InterpErrorInfo<'tcx>>
fn visit_aggregate(
&mut self,
v: &Self::V,
fields: impl Iterator<Item = Result<Self::V, InterpErrorInfo<'tcx>>>
) -> Result<(), InterpErrorInfo<'tcx>>
Visits this value as an aggregate, you are getting an iterator yielding
all the fields (still in an
InterpResult, you have to do error handling yourself).
Recurses into the fields.source§fn visit_field(
&mut self,
_old_val: &Self::V,
_field: usize,
new_val: &Self::V
) -> Result<(), InterpErrorInfo<'tcx>>
fn visit_field(
&mut self,
_old_val: &Self::V,
_field: usize,
new_val: &Self::V
) -> Result<(), InterpErrorInfo<'tcx>>
Called each time we recurse down to a field of a “product-like” aggregate
(structs, tuples, arrays and the like, but not enums), passing in old (outer)
and new (inner) value.
This gives the visitor the chance to track the stack of nested fields that
we are descending through.
source§fn visit_variant(
&mut self,
_old_val: &Self::V,
_variant: VariantIdx,
new_val: &Self::V
) -> Result<(), InterpErrorInfo<'tcx>>
fn visit_variant(
&mut self,
_old_val: &Self::V,
_variant: VariantIdx,
new_val: &Self::V
) -> Result<(), InterpErrorInfo<'tcx>>
Called when recursing into an enum variant.
This gives the visitor the chance to track the stack of nested fields that
we are descending through.
fn walk_aggregate(
&mut self,
v: &Self::V,
fields: impl Iterator<Item = Result<Self::V, InterpErrorInfo<'tcx>>>
) -> Result<(), InterpErrorInfo<'tcx>>
fn walk_value(&mut self, v: &Self::V) -> Result<(), InterpErrorInfo<'tcx>>
Auto Trait Implementations§
impl<'ecx, 'mir, 'tcx> !RefUnwindSafe for RetagVisitor<'ecx, 'mir, 'tcx>
impl<'ecx, 'mir, 'tcx> !Send for RetagVisitor<'ecx, 'mir, 'tcx>
impl<'ecx, 'mir, 'tcx> !Sync for RetagVisitor<'ecx, 'mir, 'tcx>
impl<'ecx, 'mir, 'tcx> Unpin for RetagVisitor<'ecx, 'mir, 'tcx>where
'mir: 'ecx,
'tcx: 'ecx,
impl<'ecx, 'mir, 'tcx> !UnwindSafe for RetagVisitor<'ecx, 'mir, 'tcx>
Blanket Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes