File tree 1 file changed +12
-11
lines changed
1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -652,22 +652,23 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
652
652
debug ! ( "generalize: consts c={:?}" , c) ;
653
653
match c. val {
654
654
ty:: ConstKind :: Infer ( InferConst :: Var ( vid) ) => {
655
- let mut inner = self . infcx . inner . borrow_mut ( ) ;
656
- let variable_table = & mut inner. const_unification_table ( ) ;
657
- let var_value = variable_table. probe_value ( vid) ;
655
+ let var_value =
656
+ self . infcx . inner . borrow_mut ( ) . const_unification_table ( ) . probe_value ( vid) ;
658
657
match var_value. val {
659
- ConstVariableValue :: Known { value : u } => {
660
- drop ( inner) ;
661
- self . relate ( & u, & u)
662
- }
658
+ ConstVariableValue :: Known { value : u } => self . relate ( & u, & u) ,
663
659
ConstVariableValue :: Unknown { universe } => {
664
660
if self . for_universe . can_name ( universe) {
665
661
Ok ( c)
666
662
} else {
667
- let new_var_id = variable_table. new_key ( ConstVarValue {
668
- origin : var_value. origin ,
669
- val : ConstVariableValue :: Unknown { universe : self . for_universe } ,
670
- } ) ;
663
+ let new_var_id =
664
+ self . infcx . inner . borrow_mut ( ) . const_unification_table ( ) . new_key (
665
+ ConstVarValue {
666
+ origin : var_value. origin ,
667
+ val : ConstVariableValue :: Unknown {
668
+ universe : self . for_universe ,
669
+ } ,
670
+ } ,
671
+ ) ;
671
672
Ok ( self . tcx ( ) . mk_const_var ( new_var_id, c. ty ) )
672
673
}
673
674
}
You can’t perform that action at this time.
0 commit comments