Enum rustc_const_eval::interpret::place::Place
source · pub(super) enum Place<Prov: Provenance = CtfeProvenance> {
Ptr(MemPlace<Prov>),
Local {
local: Local,
offset: Option<Size>,
locals_addr: usize,
},
}
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
.)
Local
places always refer to the current stack frame, so they are unstable under
function calls/returns and switching betweens stacks of different threads!
We carry around the address of the locals
buffer of the correct stack frame as a sanity
chec to be able to catch some cases of using a dangling Place
.
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> DynSend for Place<Prov>where
Prov: DynSend,
impl<Prov> DynSync for Place<Prov>where
Prov: DynSync,
impl<Prov> Freeze for Place<Prov>where
Prov: Freeze,
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<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
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
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for 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.