Struct rustc_ap_rustc_span::def_id::LocalDefId[][src]

pub struct LocalDefId {
    pub local_def_index: DefIndex,
}

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.

Fields

local_def_index: DefIndex

Implementations

impl LocalDefId[src]

pub fn to_def_id(self) -> DefId[src]

pub fn is_top_level_module(self) -> bool[src]

Trait Implementations

impl Clone for LocalDefId[src]

impl Copy for LocalDefId[src]

impl Debug for LocalDefId[src]

impl<D: Decoder> Decodable<D> for LocalDefId[src]

impl<E: Encoder> Encodable<E> for LocalDefId[src]

impl Eq for LocalDefId[src]

impl Hash for LocalDefId[src]

impl Idx for LocalDefId[src]

impl Ord for LocalDefId[src]

impl PartialEq<LocalDefId> for LocalDefId[src]

impl PartialOrd<LocalDefId> for LocalDefId[src]

impl StructuralEq for LocalDefId[src]

impl StructuralPartialEq for LocalDefId[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,