@@ -19,6 +19,7 @@ use std::cell::RefCell;
19
19
use std:: hash as std_hash;
20
20
use std:: mem;
21
21
use middle:: region;
22
+ use infer;
22
23
use traits;
23
24
use ty;
24
25
use mir;
@@ -85,6 +86,9 @@ for ty::RegionKind {
85
86
ty:: ReEmpty => {
86
87
// No variant fields to hash for these ...
87
88
}
89
+ ty:: ReCanonical ( c) => {
90
+ c. hash_stable ( hcx, hasher) ;
91
+ }
88
92
ty:: ReLateBound ( db, ty:: BrAnon ( i) ) => {
89
93
db. depth . hash_stable ( hcx, hasher) ;
90
94
i. hash_stable ( hcx, hasher) ;
@@ -130,6 +134,16 @@ impl<'a> HashStable<StableHashingContext<'a>> for ty::RegionVid {
130
134
}
131
135
}
132
136
137
+ impl < ' gcx > HashStable < StableHashingContext < ' gcx > > for ty:: CanonicalVar {
138
+ #[ inline]
139
+ fn hash_stable < W : StableHasherResult > ( & self ,
140
+ hcx : & mut StableHashingContext < ' gcx > ,
141
+ hasher : & mut StableHasher < W > ) {
142
+ use rustc_data_structures:: indexed_vec:: Idx ;
143
+ self . index ( ) . hash_stable ( hcx, hasher) ;
144
+ }
145
+ }
146
+
133
147
impl < ' a , ' gcx > HashStable < StableHashingContext < ' a > >
134
148
for ty:: adjustment:: AutoBorrow < ' gcx > {
135
149
fn hash_stable < W : StableHasherResult > ( & self ,
@@ -1229,11 +1243,52 @@ for traits::VtableGeneratorData<'gcx, N> where N: HashStable<StableHashingContex
1229
1243
}
1230
1244
}
1231
1245
1232
- impl < ' gcx > HashStable < StableHashingContext < ' gcx > >
1246
+ impl < ' a > HashStable < StableHashingContext < ' a > >
1233
1247
for ty:: UniverseIndex {
1234
1248
fn hash_stable < W : StableHasherResult > ( & self ,
1235
- hcx : & mut StableHashingContext < ' gcx > ,
1249
+ hcx : & mut StableHashingContext < ' a > ,
1236
1250
hasher : & mut StableHasher < W > ) {
1237
1251
self . depth ( ) . hash_stable ( hcx, hasher) ;
1238
1252
}
1239
1253
}
1254
+
1255
+ impl_stable_hash_for ! (
1256
+ impl <' tcx, V > for struct infer:: canonical:: Canonical <' tcx, V > {
1257
+ variables, value
1258
+ }
1259
+ ) ;
1260
+
1261
+ impl_stable_hash_for ! (
1262
+ impl <' tcx> for struct infer:: canonical:: CanonicalVarValues <' tcx> {
1263
+ var_values
1264
+ }
1265
+ ) ;
1266
+
1267
+ impl_stable_hash_for ! ( struct infer:: canonical:: CanonicalVarInfo {
1268
+ kind
1269
+ } ) ;
1270
+
1271
+ impl_stable_hash_for ! ( enum infer:: canonical:: CanonicalVarKind {
1272
+ Ty ( k) ,
1273
+ Region
1274
+ } ) ;
1275
+
1276
+ impl_stable_hash_for ! ( enum infer:: canonical:: CanonicalTyVarKind {
1277
+ General ,
1278
+ Int ,
1279
+ Float
1280
+ } ) ;
1281
+
1282
+ impl_stable_hash_for ! (
1283
+ impl <' tcx, R > for struct infer:: canonical:: QueryResult <' tcx, R > {
1284
+ var_values, region_constraints, certainty, value
1285
+ }
1286
+ ) ;
1287
+
1288
+ impl_stable_hash_for ! ( struct infer:: canonical:: QueryRegionConstraints <' tcx> {
1289
+ region_outlives, ty_outlives
1290
+ } ) ;
1291
+
1292
+ impl_stable_hash_for ! ( enum infer:: canonical:: Certainty {
1293
+ Proven , Ambiguous
1294
+ } ) ;
0 commit comments