11use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
22
3- use crate :: def_id:: DefId ;
43use crate :: hir:: { BodyId , Expr , ImplItemId , ItemId , Mod , TraitItemId , Ty , VisibilityKind } ;
54use crate :: hir_id:: HirId ;
65
76/// Requirements for a `StableHashingContext` to be used in this crate.
87/// This is a hack to allow using the `HashStable_Generic` derive macro
98/// instead of implementing everything in librustc.
109pub trait HashStableContext : syntax:: HashStableContext + rustc_target:: HashStableContext {
11- fn hash_def_id ( & mut self , _: DefId , hasher : & mut StableHasher ) ;
1210 fn hash_hir_id ( & mut self , _: HirId , hasher : & mut StableHasher ) ;
1311 fn hash_body_id ( & mut self , _: BodyId , hasher : & mut StableHasher ) ;
1412 fn hash_reference_to_item ( & mut self , _: HirId , hasher : & mut StableHasher ) ;
@@ -24,12 +22,6 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for HirId {
2422 }
2523}
2624
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-
3325impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for BodyId {
3426 fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
3527 hcx. hash_body_id ( * self , hasher)
0 commit comments