@@ -18,6 +18,7 @@ pub use self::RegionResolutionError::*;
18
18
pub use self :: VarValue :: * ;
19
19
20
20
use super :: { RegionVariableOrigin , SubregionOrigin , TypeTrace , MiscVariable } ;
21
+ use super :: unify_key;
21
22
22
23
use rustc_data_structures:: graph:: { self , Direction , NodeIndex } ;
23
24
use rustc_data_structures:: unify:: { self , UnificationTable } ;
@@ -345,10 +346,13 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
345
346
}
346
347
347
348
pub fn new_region_var ( & self , origin : RegionVariableOrigin ) -> RegionVid {
348
- let id = self . num_vars ( ) ;
349
+ let vid = RegionVid { index : self . num_vars ( ) } ;
349
350
self . var_origins . borrow_mut ( ) . push ( origin. clone ( ) ) ;
350
- let vid = self . unification_table . borrow_mut ( ) . new_key ( ( ) ) ;
351
- assert_eq ! ( vid. index, id) ;
351
+
352
+ let u_vid = self . unification_table . borrow_mut ( ) . new_key (
353
+ unify_key:: RegionVidKey { min_vid : vid }
354
+ ) ;
355
+ assert_eq ! ( vid, u_vid) ;
352
356
if self . in_snapshot ( ) {
353
357
self . undo_log . borrow_mut ( ) . push ( AddVar ( vid) ) ;
354
358
}
@@ -581,7 +585,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
581
585
}
582
586
583
587
pub fn opportunistic_resolve_var ( & self , rid : RegionVid ) -> ty:: Region {
584
- ty:: ReVar ( self . unification_table . borrow_mut ( ) . find ( rid) )
588
+ ty:: ReVar ( self . unification_table . borrow_mut ( ) . find_value ( rid) . min_vid )
585
589
}
586
590
587
591
fn combine_map ( & self , t : CombineMapType ) -> & RefCell < CombineMap > {
0 commit comments