Struct rustc::hir::def_id::LocalDefId
[−]
[src]
pub struct 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?
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]
pub fn from_def_id(def_id: DefId) -> LocalDefId
[src]
🔬 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]
🔬 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]
fn clone(&self) -> LocalDefId
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for LocalDefId
[src]
impl Eq for LocalDefId
[src]
impl PartialEq for LocalDefId
[src]
fn eq(&self, __arg_0: &LocalDefId) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LocalDefId) -> bool
[src]
This method tests for !=
.
impl Ord for LocalDefId
[src]
fn cmp(&self, __arg_0: &LocalDefId) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for LocalDefId
[src]
fn partial_cmp(&self, __arg_0: &LocalDefId) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &LocalDefId) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &LocalDefId) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &LocalDefId) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &LocalDefId) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for LocalDefId
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for LocalDefId
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl UseSpecializedEncodable for LocalDefId
[src]
fn default_encode<E>(&self, &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
[src]
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]
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
[src]
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<'gcx> HashStable<StableHashingContext<'gcx>> for LocalDefId
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
[src]
&self,
hcx: &mut StableHashingContext<'gcx>,
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<'gcx> ToStableHashKey<StableHashingContext<'gcx>> for LocalDefId
[src]
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<'gcx>) -> DefPathHash
[src]
🔬 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?