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

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.


owner: LocalDefIdlocal_id: ItemLocalId


impl HirId[src]

pub fn expect_owner(self) -> LocalDefId[src]

pub fn as_owner(self) -> Option<LocalDefId>[src]

pub fn make_owner(owner: LocalDefId) -> Self[src]

Trait Implementations

impl Clone for HirId[src]

impl Copy for HirId[src]

impl Debug for HirId[src]

impl<__D: Decoder> Decodable<__D> for HirId[src]

impl Display for HirId[src]

impl<__E: Encoder> Encodable<__E> 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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.