struct InternVisitor<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, MemoryKind>> {
    ecx: &'rt mut InterpCx<'mir, 'tcx, M>,
    ref_tracking: &'rt mut RefTracking<(MPlaceTy<'tcx>, InternMode)>,
    leftover_allocations: &'rt mut FxHashSet<AllocId>,
    mode: InternMode,
    inside_unsafe_cell: bool,
}

Fields

ecx: &'rt mut InterpCx<'mir, 'tcx, M>

The ectx from which we intern.

ref_tracking: &'rt mut RefTracking<(MPlaceTy<'tcx>, InternMode)>

Previously encountered safe references.

leftover_allocations: &'rt mut FxHashSet<AllocId>

A list of all encountered allocations. After type-based interning, we traverse this list to also intern allocations that are only referenced by a raw pointer or inside a union.

mode: InternMode

The root kind of the value that we’re looking at. This field is never mutated for a particular allocation. It is primarily used to make as many allocations as possible read-only so LLVM can place them in const memory.

inside_unsafe_cell: bool

This field stores whether we are currently inside an UnsafeCell. This can affect the intern mode of references we encounter.

Implementations

Trait Implementations

The visitor must have an InterpCx in it.
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. Read more
Visits the given value, dispatching as appropriate to more specialized visitors.
read_discriminant can be hooked for better error messages.
Visits the given value as a union. No automatic recursion can happen here.
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. Read more
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. Read more
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. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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: 32 bytes