pub type Key<'tcx> = CrateNum;
Aliased Type§
struct Key<'tcx> { /* private fields */ }
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: 4 bytes
Implementations
Source§impl CrateNum
impl CrateNum
Sourcepub const MAX_AS_U32: u32 = 4_294_967_040u32
pub const MAX_AS_U32: u32 = 4_294_967_040u32
Maximum value the index can take, as a u32
.
Sourcepub const fn from_usize(value: usize) -> CrateNum
pub const fn from_usize(value: usize) -> CrateNum
Sourcepub const unsafe fn from_u32_unchecked(value: u32) -> CrateNum
pub const unsafe fn from_u32_unchecked(value: u32) -> CrateNum
Creates a new index from a given u32
.
§Safety
The provided value must be less than or equal to the maximum value for the newtype. Providing a value outside this range is undefined due to layout restrictions.
Prefer using from_u32
.
Trait Implementations
Source§impl AsLocalKey for CrateNum
impl AsLocalKey for CrateNum
type LocalKey = LocalCrate
Source§fn as_local_key(&self) -> Option<Self::LocalKey>
fn as_local_key(&self) -> Option<Self::LocalKey>
Given an instance of this key, what crate is it referring to?
This is used to find the provider.
Source§impl<D> Decodable<D> for CrateNumwhere
D: SpanDecoder,
impl<D> Decodable<D> for CrateNumwhere
D: SpanDecoder,
Source§impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for CrateNum
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for CrateNum
fn fingerprint_style() -> FingerprintStyle
Source§fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint
fn to_fingerprint(&self, tcx: TyCtxt<'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).
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String
Source§fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>
fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>
This method tries to recover the query key from the given
DepNode
,
something which is needed when forcing DepNode
s 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<CTX> HashStable<CTX> for CrateNumwhere
CTX: HashStableContext,
impl<CTX> HashStable<CTX> for CrateNumwhere
CTX: HashStableContext,
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher<SipHasher128>)
Source§impl Key for CrateNum
impl Key for CrateNum
Source§type Cache<V> = VecCache<CrateNum, V, DepNodeIndex>
type Cache<V> = VecCache<CrateNum, V, DepNodeIndex>
The type of in-memory cache to use for queries with this key type. Read more
Source§fn default_span(&self, _: TyCtxt<'_>) -> Span
fn default_span(&self, _: TyCtxt<'_>) -> Span
In the event that a cycle occurs, if no explicit span has been
given for a query with key
self
, what span should we use?Source§fn key_as_def_id(&self) -> Option<DefId>
fn key_as_def_id(&self) -> Option<DefId>
Source§fn def_id_for_ty_in_cycle(&self) -> Option<DefId>
fn def_id_for_ty_in_cycle(&self) -> Option<DefId>
Used to detect when ADT def ids are used as keys in a cycle for better error reporting.
Source§impl Ord for CrateNum
impl Ord for CrateNum
Source§impl PartialOrd for CrateNum
impl PartialOrd for CrateNum
Source§impl Step for CrateNum
impl Step for CrateNum
Source§fn steps_between(start: &CrateNum, end: &CrateNum) -> (usize, Option<usize>)
fn steps_between(start: &CrateNum, end: &CrateNum) -> (usize, Option<usize>)
🔬This is a nightly-only experimental API. (
step_trait
)Returns the bounds on the number of successor steps required to get from
start
to end
like Iterator::size_hint()
. Read moreSource§fn forward_checked(start: CrateNum, u: usize) -> Option<CrateNum>
fn forward_checked(start: CrateNum, u: usize) -> Option<CrateNum>
🔬This is a nightly-only experimental API. (
step_trait
)Source§fn backward_checked(start: CrateNum, u: usize) -> Option<CrateNum>
fn backward_checked(start: CrateNum, u: usize) -> Option<CrateNum>
🔬This is a nightly-only experimental API. (
step_trait
)Source§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)Source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)Source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)Source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)