[][src]Struct rustc_hir::hir_id::HirId

pub struct HirId {
    pub owner: LocalDefId,
    pub local_id: ItemLocalId,
}

Uniquely identifies a node in the HIR of the current crate. It is composed of the owner, which is the LocalDefId of the directly enclosing hir::Item, hir::TraitItem, or hir::ImplItem (i.e., the closest "item-like"), and the local_id which is unique within the given owner.

This two-level structure makes for more stable values: One can move an item around within the source code, or add or remove stuff before it, without the local_id part of the HirId changing, which is a very useful property in incremental compilation where we have to persist things through changes to the code base.

Fields

owner: LocalDefIdlocal_id: ItemLocalId

Trait Implementations

impl Clone for HirId[src]

impl Copy for HirId[src]

impl Debug for HirId[src]

impl Decodable for HirId[src]

impl Display for HirId[src]

impl Encodable for HirId[src]

impl Eq for HirId[src]

impl Hash for HirId[src]

impl<HirCtx: HashStableContext> HashStable<HirCtx> for HirId[src]

impl Ord for HirId[src]

impl PartialEq<HirId> for HirId[src]

impl PartialOrd<HirId> for HirId[src]

impl StructuralEq for HirId[src]

impl StructuralPartialEq for HirId[src]

impl<HirCtx: HashStableContext> ToStableHashKey<HirCtx> for HirId[src]

Auto Trait Implementations

impl RefUnwindSafe for HirId

impl Send for HirId

impl Sync for HirId

impl Unpin for HirId

impl UnwindSafe for HirId

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<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.