Move some HashStable impls.
This commit is contained in:
parent
c24c9067ee
commit
b66dfaaa64
3 changed files with 22 additions and 44 deletions
|
@ -33,6 +33,25 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for HirId {
|
|||
}
|
||||
}
|
||||
|
||||
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ItemLocalId {
|
||||
type KeyType = ItemLocalId;
|
||||
|
||||
#[inline]
|
||||
fn to_stable_hash_key(&self, _: &HirCtx) -> ItemLocalId {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for BodyId {
|
||||
type KeyType = (DefPathHash, ItemLocalId);
|
||||
|
||||
#[inline]
|
||||
fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) {
|
||||
let BodyId { hir_id } = *self;
|
||||
hir_id.to_stable_hash_key(hcx)
|
||||
}
|
||||
}
|
||||
|
||||
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ItemId {
|
||||
type KeyType = DefPathHash;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue