Use ItemId as a strongly typed index.
This commit is contained in:
parent
ac8961fc04
commit
c676e358a5
28 changed files with 63 additions and 51 deletions
|
@ -34,6 +34,15 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for HirId {
|
|||
}
|
||||
}
|
||||
|
||||
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ItemId {
|
||||
type KeyType = (DefPathHash, ItemLocalId);
|
||||
|
||||
#[inline]
|
||||
fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) {
|
||||
self.id.to_stable_hash_key(hcx)
|
||||
}
|
||||
}
|
||||
|
||||
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for TraitItemId {
|
||||
type KeyType = (DefPathHash, ItemLocalId);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue