Enum rustc_const_eval::interpret::place::Place
source · pub(super) enum Place<Prov: Provenance = AllocId> {
Ptr(MemPlace<Prov>),
Local {
frame: usize,
local: Local,
offset: Option<Size>,
},
}
Variants§
Ptr(MemPlace<Prov>)
A place referring to a value allocated in the Memory
system.
Local
To support alloc-free locals, we are able to write directly to a local. The offset indicates
where in the local this place is located; if it is None
, no projection has been applied.
Such projections are meaningful even if the offset is 0, since they can change layouts.
(Without that optimization, we’d just always be a MemPlace
.)
Note that this only stores the frame index, not the thread this frame belongs to – that is
implicit. This means a Place
must never be moved across interpreter thread boundaries!
This variant shall not be used for unsized types – those must always live in memory.
Trait Implementations§
impl<Prov: Copy + Provenance> Copy for Place<Prov>
Auto Trait Implementations§
impl<Prov> RefUnwindSafe for Place<Prov>where Prov: RefUnwindSafe,
impl<Prov> Send for Place<Prov>where Prov: Send,
impl<Prov> Sync for Place<Prov>where Prov: Sync,
impl<Prov> Unpin for Place<Prov>where Prov: Unpin,
impl<Prov> UnwindSafe for Place<Prov>where Prov: UnwindSafe,
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
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.