[][src]Struct rustc::hir::HirId

pub struct HirId {
    pub owner: DefIndex,
    pub local_id: ItemLocalId,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Uniquely identifies a node in the HIR of the current crate. It is composed of the owner, which is the DefIndex 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: DefIndex
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

local_id: ItemLocalId
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Methods

impl HirId[src]

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

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait Implementations

impl<'tcx> DepNodeParams<'tcx> for HirId[src]

impl Clone for HirId[src]

impl Copy for HirId[src]

impl Eq for HirId[src]

impl Ord for HirId[src]

impl PartialEq<HirId> for HirId[src]

impl PartialOrd<HirId> for HirId[src]

impl Display for HirId[src]

impl Debug for HirId[src]

impl<'a, V> Index<HirId> for LocalTableInContext<'a, V>[src]

type Output = V

The returned type after indexing.

impl Hash for HirId[src]

impl<'a> HashStable<StableHashingContext<'a>> for HirId[src]

impl<'a> ToStableHashKey<StableHashingContext<'a>> for HirId[src]

type KeyType = (DefPathHash, ItemLocalId)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx, E> SpecializedEncoder<HirId> for CacheEncoder<'a, 'tcx, E> where
    E: 'a + TyEncoder
[src]

impl<'a, 'tcx> SpecializedDecoder<HirId> for CacheDecoder<'a, 'tcx>[src]

impl UseSpecializedEncodable for HirId[src]

impl UseSpecializedDecodable for HirId[src]

Auto Trait Implementations

impl Send for HirId

impl Sync for HirId

impl Unpin for HirId

impl UnwindSafe for HirId

impl RefUnwindSafe for HirId

Blanket Implementations

impl<T> ArenaAllocatable for T where
    T: Copy
[src]

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

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

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

impl<T> From<T> for 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.

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

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

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

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

impl<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<T> Erased for T[src]

impl<E> SpecializationError for E[src]

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