@@ -11,19 +11,20 @@ use rustc_data_structures::stable_hasher::HashingControls;
11
11
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher , ToStableHashKey } ;
12
12
use rustc_query_system:: ich:: StableHashingContext ;
13
13
use std:: cell:: RefCell ;
14
+ use std:: ptr;
14
15
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 >
16
17
where
17
18
T : HashStable < StableHashingContext < ' a > > ,
18
19
{
19
20
fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
20
21
thread_local ! {
21
- static CACHE : RefCell <FxHashMap <( usize , usize , HashingControls ) , Fingerprint >> =
22
+ static CACHE : RefCell <FxHashMap <( * const ( ) , HashingControls ) , Fingerprint >> =
22
23
RefCell :: new( Default :: default ( ) ) ;
23
24
}
24
25
25
26
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 ( ) ) ;
27
28
if let Some ( & hash) = cache. borrow ( ) . get ( & key) {
28
29
return hash;
29
30
}
40
41
}
41
42
}
42
43
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 >
44
45
where
45
46
T : HashStable < StableHashingContext < ' a > > ,
46
47
{
55
56
}
56
57
}
57
58
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
-
68
59
impl < ' a > ToStableHashKey < StableHashingContext < ' a > > for SimplifiedType {
69
60
type KeyType = Fingerprint ;
70
61
0 commit comments