struct UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>where
    F: FnMut(&MPlaceTy<'tcx, Provenance>) -> InterpResult<'tcx>,{
    ecx: &'ecx MiriInterpCx<'mir, 'tcx>,
    unsafe_cell_action: F,
}
Expand description

Visiting the memory covered by a MemPlace, being aware of whether we are inside an UnsafeCell or not.

Fields§

§ecx: &'ecx MiriInterpCx<'mir, 'tcx>§unsafe_cell_action: F

Trait Implementations§

source§

impl<'ecx, 'mir, 'tcx: 'mir, F> ValueVisitor<'mir, 'tcx, MiriMachine<'mir, 'tcx>> for UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>where F: FnMut(&MPlaceTy<'tcx, Provenance>) -> InterpResult<'tcx>,

§

type V = MPlaceTy<'tcx, Provenance>

source§

fn ecx(&self) -> &MiriInterpCx<'mir, 'tcx>

The visitor must have an InterpCx in it.
source§

fn visit_value(&mut self, v: &MPlaceTy<'tcx, Provenance>) -> InterpResult<'tcx>

Visits the given value, dispatching as appropriate to more specialized visitors.
source§

fn visit_aggregate( &mut self, place: &MPlaceTy<'tcx, Provenance>, fields: impl Iterator<Item = InterpResult<'tcx, MPlaceTy<'tcx, Provenance>>> ) -> InterpResult<'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_union( &mut self, _v: &MPlaceTy<'tcx, Provenance>, _fields: NonZeroUsize ) -> InterpResult<'tcx>

Visits the given value as a union. No automatic recursion can happen here.
source§

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_box(&mut self, _v: &Self::V) -> Result<(), InterpErrorInfo<'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_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>>

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

fn walk_aggregate( &mut self, v: &Self::V, fields: impl Iterator<Item = Result<Self::V, InterpErrorInfo<'tcx>>> ) -> Result<(), InterpErrorInfo<'tcx>>

source§

fn walk_value(&mut self, v: &Self::V) -> Result<(), InterpErrorInfo<'tcx>>

Auto Trait Implementations§

§

impl<'ecx, 'mir, 'tcx, F> !RefUnwindSafe for UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>

§

impl<'ecx, 'mir, 'tcx, F> !Send for UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>

§

impl<'ecx, 'mir, 'tcx, F> !Sync for UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>

§

impl<'ecx, 'mir, 'tcx, F> Unpin for UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>where F: Unpin, 'mir: 'ecx, 'tcx: 'ecx,

§

impl<'ecx, 'mir, 'tcx, F> !UnwindSafe for UnsafeCellVisitor<'ecx, 'mir, 'tcx, F>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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