rustc_middle::ty::vtable

Function vtable_allocation_provider

Source
pub(super) fn vtable_allocation_provider<'tcx>(
    tcx: TyCtxt<'tcx>,
    key: (Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>),
) -> AllocId
Expand description

Retrieves an allocation that represents the contents of a vtable. Since this is a query, allocations are cached and not duplicated.

This is an “internal” AllocId that should never be used as a value in the interpreted program. The interpreter should use AllocId that refer to a GlobalAlloc::VTable instead. (This is similar to statics, which also have a similar “internal” AllocId storing their initial contents.)