@@ -420,7 +420,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
420
420
// `RegionConstraintData` contains the relationship here.
421
421
if * any_unifications {
422
422
* any_unifications = false ;
423
- self . unification_table ( ) . reset_unifications ( |_| UnifiedRegion ( None ) ) ;
423
+ self . unification_table_mut ( ) . reset_unifications ( |_| UnifiedRegion ( None ) ) ;
424
424
}
425
425
426
426
data
@@ -447,7 +447,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
447
447
) -> RegionVid {
448
448
let vid = self . var_infos . push ( RegionVariableInfo { origin, universe } ) ;
449
449
450
- let u_vid = self . unification_table ( ) . new_key ( UnifiedRegion ( None ) ) ;
450
+ let u_vid = self . unification_table_mut ( ) . new_key ( UnifiedRegion ( None ) ) ;
451
451
assert_eq ! ( vid, u_vid. vid) ;
452
452
self . undo_log . push ( AddVar ( vid) ) ;
453
453
debug ! ( "created new region variable {:?} in {:?} with origin {:?}" , vid, universe, origin) ;
@@ -516,13 +516,13 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
516
516
match ( sub, sup) {
517
517
( Region ( Interned ( ReVar ( sub) , _) ) , Region ( Interned ( ReVar ( sup) , _) ) ) => {
518
518
debug ! ( "make_eqregion: unifying {:?} with {:?}" , sub, sup) ;
519
- self . unification_table ( ) . union ( * sub, * sup) ;
519
+ self . unification_table_mut ( ) . union ( * sub, * sup) ;
520
520
self . any_unifications = true ;
521
521
}
522
522
( Region ( Interned ( ReVar ( vid) , _) ) , value)
523
523
| ( value, Region ( Interned ( ReVar ( vid) , _) ) ) => {
524
524
debug ! ( "make_eqregion: unifying {:?} with {:?}" , vid, value) ;
525
- self . unification_table ( ) . union_value ( * vid, UnifiedRegion ( Some ( value) ) ) ;
525
+ self . unification_table_mut ( ) . union_value ( * vid, UnifiedRegion ( Some ( value) ) ) ;
526
526
self . any_unifications = true ;
527
527
}
528
528
( _, _) => { }
@@ -640,8 +640,9 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
640
640
tcx : TyCtxt < ' tcx > ,
641
641
vid : ty:: RegionVid ,
642
642
) -> ty:: Region < ' tcx > {
643
- let root_vid = self . unification_table ( ) . find ( vid) . vid ;
644
- self . unification_table ( ) . probe_value ( root_vid) . 0 . unwrap_or_else ( || tcx. mk_re_var ( root_vid) )
643
+ let mut ut = self . unification_table_mut ( ) ; // FIXME(rust-lang/ena#42): unnecessary mut
644
+ let root_vid = ut. find ( vid) . vid ;
645
+ ut. probe_value ( root_vid) . 0 . unwrap_or_else ( || tcx. mk_re_var ( root_vid) )
645
646
}
646
647
647
648
fn combine_map ( & mut self , t : CombineMapType ) -> & mut CombineMap < ' tcx > {
@@ -719,7 +720,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
719
720
}
720
721
721
722
#[ inline]
722
- fn unification_table ( & mut self ) -> super :: UnificationTable < ' _ , ' tcx , RegionVidKey < ' tcx > > {
723
+ fn unification_table_mut ( & mut self ) -> super :: UnificationTable < ' _ , ' tcx , RegionVidKey < ' tcx > > {
723
724
ut:: UnificationTable :: with_log ( & mut self . storage . unification_table , self . undo_log )
724
725
}
725
726
}
0 commit comments