Use ItemId as a strongly typed index.

This commit is contained in:
Camille GILLOT 2021-01-30 12:06:04 +01:00
parent ac8961fc04
commit c676e358a5
28 changed files with 63 additions and 51 deletions

View file

@ -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);