pub struct CtfeProvenance(NonZero<u64>);Expand description
The type of provenance in the compile-time interpreter. This is a packed representation of:
- an AllocId(non-zero)
- an immutable: bool
- a shared_ref: bool
with the extra invariant that if immutable is true, then so
is shared_ref.
Tuple Fields§
§0: NonZero<u64>Implementations§
Source§impl CtfeProvenance
 
impl CtfeProvenance
Returns whether this provenance is derived from a shared reference.
pub fn into_parts(self) -> (AllocId, bool, bool)
pub fn from_parts( (alloc_id, immutable, shared_ref): (AllocId, bool, bool), ) -> Self
Sourcepub fn as_immutable(self) -> Self
 
pub fn as_immutable(self) -> Self
Returns an immutable version of this provenance.
Returns a “shared reference” (but not necessarily immutable!) version of this provenance.
Trait Implementations§
Source§impl Clone for CtfeProvenance
 
impl Clone for CtfeProvenance
Source§fn clone(&self) -> CtfeProvenance
 
fn clone(&self) -> CtfeProvenance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for CtfeProvenance
 
impl Debug for CtfeProvenance
Source§impl<'tcx, D: TyDecoder<'tcx>> Decodable<D> for CtfeProvenance
 
impl<'tcx, D: TyDecoder<'tcx>> Decodable<D> for CtfeProvenance
Source§impl<'tcx, E: TyEncoder<'tcx>> Encodable<E> for CtfeProvenance
 
impl<'tcx, E: TyEncoder<'tcx>> Encodable<E> for CtfeProvenance
Source§impl From<AllocId> for CtfeProvenance
 
impl From<AllocId> for CtfeProvenance
Source§impl From<CtfeProvenance> for Pointer
 
impl From<CtfeProvenance> for Pointer
Source§fn from(prov: CtfeProvenance) -> Self
 
fn from(prov: CtfeProvenance) -> Self
Converts to this type from the input type.
Source§impl Hash for CtfeProvenance
 
impl Hash for CtfeProvenance
Source§impl<'a> HashStable<StableHashingContext<'a>> for CtfeProvenance
 
impl<'a> HashStable<StableHashingContext<'a>> for CtfeProvenance
fn hash_stable( &self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher, )
Source§impl Ord for CtfeProvenance
 
impl Ord for CtfeProvenance
Source§fn cmp(&self, other: &CtfeProvenance) -> Ordering
 
fn cmp(&self, other: &CtfeProvenance) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CtfeProvenance
 
impl PartialEq for CtfeProvenance
Source§impl PartialOrd for CtfeProvenance
 
impl PartialOrd for CtfeProvenance
Source§impl Provenance for CtfeProvenance
 
impl Provenance for CtfeProvenance
Source§const OFFSET_IS_ADDR: bool = false
 
const OFFSET_IS_ADDR: bool = false
Says whether the 
offset field of Pointers with this provenance is the actual physical address. Read moreSource§const WILDCARD: Option<Self> = None
 
const WILDCARD: Option<Self> = None
If wildcard provenance is implemented, contains the unique, general wildcard provenance variant.
Source§fn fmt(ptr: &Pointer<Self>, f: &mut Formatter<'_>) -> Result
 
fn fmt(ptr: &Pointer<Self>, f: &mut Formatter<'_>) -> Result
Determines how a pointer should be printed.
Source§fn get_alloc_id(self) -> Option<AllocId>
 
fn get_alloc_id(self) -> Option<AllocId>
If 
OFFSET_IS_ADDR == false, provenance must always be able to
identify the allocation this ptr points to (i.e., this must return Some).
Otherwise this function is best-effort (but must agree with Machine::ptr_get_alloc).
(Identifying the offset in that allocation, however, is harder – use Memory::ptr_get_alloc for that.)impl Copy for CtfeProvenance
impl Eq for CtfeProvenance
impl StructuralPartialEq for CtfeProvenance
Auto Trait Implementations§
impl DynSend for CtfeProvenance
impl DynSync for CtfeProvenance
impl Freeze for CtfeProvenance
impl RefUnwindSafe for CtfeProvenance
impl Send for CtfeProvenance
impl Sync for CtfeProvenance
impl Unpin for CtfeProvenance
impl UnwindSafe for CtfeProvenance
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(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx 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(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
 
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
Source§impl<Tcx, T> DepNodeParams<Tcx> for T
 
impl<Tcx, T> DepNodeParams<Tcx> for T
default fn fingerprint_style() -> FingerprintStyle
Source§default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
 
default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
This method turns the parameters of a DepNodeConstructor into an opaque
Fingerprint to be used in DepNode.
Not all DepNodeParams support being turned into a Fingerprint (they
don’t need to if the corresponding DepNode is anonymous).
default fn to_debug_str(&self, tcx: Tcx) -> String
Source§default fn recover(_: Tcx, _: &DepNode) -> Option<T>
 
default fn recover(_: Tcx, _: &DepNode) -> Option<T>
This method tries to recover the query key from the given 
DepNode,
something which is needed when forcing DepNodes during red-green
evaluation. The query system will only call this method if
fingerprint_style() is not FingerprintStyle::Opaque.
It is always valid to return None here, in which case incremental
compilation will treat the query as having changed instead of forcing it.Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.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<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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
Source§impl<T> Pointable for T
 
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
    U: UpcastFrom<I, T>,
 
impl<I, T, U> Upcast<I, U> for Twhere
    U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
 
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> 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<T> ErasedDestructor for Twhere
    T: 'static,
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: 8 bytes