1
1
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
2
2
3
- use crate :: def_id:: DefId ;
4
3
use crate :: hir:: { BodyId , Expr , ImplItemId , ItemId , Mod , TraitItemId , Ty , VisibilityKind } ;
5
4
use crate :: hir_id:: HirId ;
6
5
7
6
/// Requirements for a `StableHashingContext` to be used in this crate.
8
7
/// This is a hack to allow using the `HashStable_Generic` derive macro
9
8
/// instead of implementing everything in librustc.
10
9
pub trait HashStableContext : syntax:: HashStableContext + rustc_target:: HashStableContext {
11
- fn hash_def_id ( & mut self , _: DefId , hasher : & mut StableHasher ) ;
12
10
fn hash_hir_id ( & mut self , _: HirId , hasher : & mut StableHasher ) ;
13
11
fn hash_body_id ( & mut self , _: BodyId , hasher : & mut StableHasher ) ;
14
12
fn hash_reference_to_item ( & mut self , _: HirId , hasher : & mut StableHasher ) ;
@@ -24,12 +22,6 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for HirId {
24
22
}
25
23
}
26
24
27
- impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for DefId {
28
- fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
29
- hcx. hash_def_id ( * self , hasher)
30
- }
31
- }
32
-
33
25
impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for BodyId {
34
26
fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
35
27
hcx. hash_body_id ( * self , hasher)
0 commit comments