Struct rustc_span::def_id::LocalDefId
source · [−]pub struct LocalDefId {
pub local_def_index: DefIndex,
}
Expand description
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 DefId
s from upstream crates get thrown into the mix. There are quite a
few cases where we know that only DefId
s from the local crate are expected;
a DefId
from a different crate would signify a bug somewhere. This
is when LocalDefId
comes in handy.
Fields
local_def_index: DefIndex
Implementations
sourceimpl LocalDefId
impl LocalDefId
Trait Implementations
sourceimpl Clone for LocalDefId
impl Clone for LocalDefId
sourcefn clone(&self) -> LocalDefId
fn clone(&self) -> LocalDefId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LocalDefId
impl Debug for LocalDefId
sourceimpl<D: Decoder> Decodable<D> for LocalDefId
impl<D: Decoder> Decodable<D> for LocalDefId
fn decode(d: &mut D) -> LocalDefId
sourceimpl From<LocalDefId> for DefId
impl From<LocalDefId> for DefId
sourcefn from(local: LocalDefId) -> DefId
fn from(local: LocalDefId) -> DefId
Converts to this type from the input type.
sourceimpl Hash for LocalDefId
impl Hash for LocalDefId
sourceimpl<CTX: HashStableContext> HashStable<CTX> for LocalDefId
impl<CTX: HashStableContext> HashStable<CTX> for LocalDefId
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)
sourceimpl Idx for LocalDefId
impl Idx for LocalDefId
sourceimpl !Ord for LocalDefId
impl !Ord for LocalDefId
sourceimpl PartialEq<LocalDefId> for LocalDefId
impl PartialEq<LocalDefId> for LocalDefId
sourcefn eq(&self, other: &LocalDefId) -> bool
fn eq(&self, other: &LocalDefId) -> bool
sourceimpl !PartialOrd<LocalDefId> for LocalDefId
impl !PartialOrd<LocalDefId> for LocalDefId
1.0.0 · sourcefn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<CTX: HashStableContext> ToStableHashKey<CTX> for LocalDefId
impl<CTX: HashStableContext> ToStableHashKey<CTX> for LocalDefId
type KeyType = DefPathHash
fn to_stable_hash_key(&self, hcx: &CTX) -> DefPathHash
impl Copy for LocalDefId
impl Eq for LocalDefId
impl StructuralEq for LocalDefId
impl StructuralPartialEq for LocalDefId
Auto Trait Implementations
impl RefUnwindSafe for LocalDefId
impl Send for LocalDefId
impl Sync for LocalDefId
impl Unpin for LocalDefId
impl UnwindSafe for LocalDefId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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