File tree 2 files changed +3
-35
lines changed
2 files changed +3
-35
lines changed Original file line number Diff line number Diff line change @@ -61,37 +61,6 @@ impl<W: StableHasherResult> StableHasher<W> {
61
61
}
62
62
}
63
63
64
- impl StableHasherResult for [ u8 ; 20 ] {
65
- fn finish ( hasher : StableHasher < Self > ) -> Self {
66
- let ( _0, _1) = hasher. finalize ( ) ;
67
-
68
- [
69
- ( _0 >> 0 ) as u8 ,
70
- ( _0 >> 8 ) as u8 ,
71
- ( _0 >> 16 ) as u8 ,
72
- ( _0 >> 24 ) as u8 ,
73
- ( _0 >> 32 ) as u8 ,
74
- ( _0 >> 40 ) as u8 ,
75
- ( _0 >> 48 ) as u8 ,
76
- ( _0 >> 56 ) as u8 ,
77
-
78
- 17 ,
79
- 33 ,
80
- 47 ,
81
- 3 ,
82
-
83
- ( _1 >> 0 ) as u8 ,
84
- ( _1 >> 8 ) as u8 ,
85
- ( _1 >> 16 ) as u8 ,
86
- ( _1 >> 24 ) as u8 ,
87
- ( _1 >> 32 ) as u8 ,
88
- ( _1 >> 40 ) as u8 ,
89
- ( _1 >> 48 ) as u8 ,
90
- ( _1 >> 56 ) as u8 ,
91
- ]
92
- }
93
- }
94
-
95
64
impl StableHasherResult for u128 {
96
65
fn finish ( hasher : StableHasher < Self > ) -> Self {
97
66
let ( _0, _1) = hasher. finalize ( ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ use rustc::ty::fold::TypeVisitor;
30
30
use rustc:: ty:: subst:: Substs ;
31
31
use rustc:: ty:: util:: TypeIdHasher ;
32
32
use rustc:: hir;
33
- use rustc_data_structures :: ToHex ;
33
+ use rustc :: ich :: Fingerprint ;
34
34
use { type_of, machine, monomorphize} ;
35
35
use common:: { self , CrateContext } ;
36
36
use type_:: Type ;
@@ -146,11 +146,10 @@ impl<'tcx> TypeMap<'tcx> {
146
146
147
147
// The hasher we are using to generate the UniqueTypeId. We want
148
148
// something that provides more than the 64 bits of the DefaultHasher.
149
-
150
- let mut type_id_hasher = TypeIdHasher :: < [ u8 ; 20 ] > :: new ( cx. tcx ( ) ) ;
149
+ let mut type_id_hasher = TypeIdHasher :: < Fingerprint > :: new ( cx. tcx ( ) ) ;
151
150
type_id_hasher. visit_ty ( type_) ;
152
-
153
151
let unique_type_id = type_id_hasher. finish ( ) . to_hex ( ) ;
152
+
154
153
let key = self . unique_id_interner . intern ( & unique_type_id) ;
155
154
self . type_to_unique_id . insert ( type_, UniqueTypeId ( key) ) ;
156
155
You can’t perform that action at this time.
0 commit comments