Only store a LocalDefId in hir::Item.
Items are guaranteed to be HIR owner.
This commit is contained in:
parent
bd3cd5dbed
commit
cebbba081e
86 changed files with 483 additions and 565 deletions
|
@ -227,6 +227,8 @@ pub struct LocalDefId {
|
|||
pub local_def_index: DefIndex,
|
||||
}
|
||||
|
||||
pub const CRATE_DEF_ID: LocalDefId = LocalDefId { local_def_index: CRATE_DEF_INDEX };
|
||||
|
||||
impl Idx for LocalDefId {
|
||||
#[inline]
|
||||
fn new(idx: usize) -> Self {
|
||||
|
@ -268,6 +270,8 @@ impl<D: Decoder> Decodable<D> for LocalDefId {
|
|||
}
|
||||
}
|
||||
|
||||
rustc_data_structures::define_id_collections!(LocalDefIdMap, LocalDefIdSet, LocalDefId);
|
||||
|
||||
impl<CTX: HashStableContext> HashStable<CTX> for DefId {
|
||||
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
|
||||
hcx.hash_def_id(*self, hasher)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue