Struct rustc::hir::def_id::LocalDefId [−][src]
pub struct LocalDefId(DefIndex);
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A LocalDefId is equivalent to a DefId with krate == LOCAL_CRATE
. Since
we encode this information in the type, we can ensure at compile time that
no DefIds from upstream crates get thrown into the mix. There are quite a
few cases where we know that only DefIds from the local crate are expected
and a DefId from a different crate would signify a bug somewhere. This
is when LocalDefId comes in handy.
Methods
impl LocalDefId
[src]
impl LocalDefId
pub fn from_def_id(def_id: DefId) -> LocalDefId
[src]
pub fn from_def_id(def_id: DefId) -> LocalDefId
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn to_def_id(self) -> DefId
[src]
pub fn to_def_id(self) -> DefId
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl Clone for LocalDefId
[src]
impl Clone for LocalDefId
fn clone(&self) -> LocalDefId
[src]
fn clone(&self) -> LocalDefId
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for LocalDefId
[src]
impl Copy for LocalDefId
impl PartialEq for LocalDefId
[src]
impl PartialEq for LocalDefId
fn eq(&self, other: &LocalDefId) -> bool
[src]
fn eq(&self, other: &LocalDefId) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &LocalDefId) -> bool
[src]
fn ne(&self, other: &LocalDefId) -> bool
This method tests for !=
.
impl Eq for LocalDefId
[src]
impl Eq for LocalDefId
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Hash for LocalDefId
[src]
impl Hash for LocalDefId
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for LocalDefId
[src]
impl Debug for LocalDefId
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl UseSpecializedEncodable for LocalDefId
[src]
impl UseSpecializedEncodable for LocalDefId
fn default_encode<E>(&self, &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
[src]
fn default_encode<E>(&self, &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Defaults to returning an error (see SpecializationError
).
impl UseSpecializedDecodable for LocalDefId
[src]
impl UseSpecializedDecodable for LocalDefId
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
[src]
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Defaults to returning an error (see SpecializationError
).
impl<'a> HashStable<StableHashingContext<'a>> for LocalDefId
[src]
impl<'a> HashStable<StableHashingContext<'a>> for LocalDefId
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a> ToStableHashKey<StableHashingContext<'a>> for LocalDefId
[src]
impl<'a> ToStableHashKey<StableHashingContext<'a>> for LocalDefId
type KeyType = DefPathHash
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn to_stable_hash_key(&self, hcx: &StableHashingContext<'a>) -> DefPathHash
[src]
fn to_stable_hash_key(&self, hcx: &StableHashingContext<'a>) -> DefPathHash
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, 'tcx, 'x> SpecializedDecoder<LocalDefId> for CacheDecoder<'a, 'tcx, 'x>
[src]
impl<'a, 'tcx, 'x> SpecializedDecoder<LocalDefId> for CacheDecoder<'a, 'tcx, 'x>
fn specialized_decode(&mut self) -> Result<LocalDefId, Self::Error>
[src]
fn specialized_decode(&mut self) -> Result<LocalDefId, Self::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Decode a value in a manner specific to this decoder state.
impl<'enc, 'a, 'tcx, E> SpecializedEncoder<LocalDefId> for CacheEncoder<'enc, 'a, 'tcx, E> where
E: 'enc + TyEncoder,
[src]
impl<'enc, 'a, 'tcx, E> SpecializedEncoder<LocalDefId> for CacheEncoder<'enc, 'a, 'tcx, E> where
E: 'enc + TyEncoder,
fn specialized_encode(&mut self, id: &LocalDefId) -> Result<(), Self::Error>
[src]
fn specialized_encode(&mut self, id: &LocalDefId) -> Result<(), Self::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Encode the value in a manner specific to this encoder state.
Auto Trait Implementations
impl Send for LocalDefId
impl Send for LocalDefId
impl Sync for LocalDefId
impl Sync for LocalDefId