@@ -11,19 +11,20 @@ use rustc_data_structures::stable_hasher::HashingControls;
1111use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher , ToStableHashKey } ;
1212use rustc_query_system:: ich:: StableHashingContext ;
1313use std:: cell:: RefCell ;
14+ use std:: ptr;
1415
15- impl < ' a , ' tcx , T > HashStable < StableHashingContext < ' a > > for & ' tcx ty:: List < T >
16+ impl < ' a , ' tcx , H , T > HashStable < StableHashingContext < ' a > > for & ' tcx ty:: list :: RawList < H , T >
1617where
1718 T : HashStable < StableHashingContext < ' a > > ,
1819{
1920 fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
2021 thread_local ! {
21- static CACHE : RefCell <FxHashMap <( usize , usize , HashingControls ) , Fingerprint >> =
22+ static CACHE : RefCell <FxHashMap <( * const ( ) , HashingControls ) , Fingerprint >> =
2223 RefCell :: new( Default :: default ( ) ) ;
2324 }
2425
2526 let hash = CACHE . with ( |cache| {
26- let key = ( self . as_ptr ( ) as usize , self . len ( ) , hcx. hashing_controls ( ) ) ;
27+ let key = ( ptr :: from_ref ( * self ) . cast :: < ( ) > ( ) , hcx. hashing_controls ( ) ) ;
2728 if let Some ( & hash) = cache. borrow ( ) . get ( & key) {
2829 return hash;
2930 }
4041 }
4142}
4243
43- impl < ' a , ' tcx , T > ToStableHashKey < StableHashingContext < ' a > > for & ' tcx ty:: List < T >
44+ impl < ' a , ' tcx , H , T > ToStableHashKey < StableHashingContext < ' a > > for & ' tcx ty:: list :: RawList < H , T >
4445where
4546 T : HashStable < StableHashingContext < ' a > > ,
4647{
5556 }
5657}
5758
58- impl < ' a , ' tcx , T > HashStable < StableHashingContext < ' a > > for & ' tcx ty:: ListWithCachedTypeInfo < T >
59- where
60- T : HashStable < StableHashingContext < ' a > > ,
61- {
62- #[ inline]
63- fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
64- self . as_list ( ) . hash_stable ( hcx, hasher) ;
65- }
66- }
67-
6859impl < ' a > ToStableHashKey < StableHashingContext < ' a > > for SimplifiedType {
6960 type KeyType = Fingerprint ;
7061
0 commit comments