@@ -562,7 +562,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
562
562
obligation : & PredicateObligation < ' tcx > ,
563
563
) -> Result < EvaluationResult , OverflowError > {
564
564
debug_assert ! ( !self . infcx. next_trait_solver( ) ) ;
565
- self . evaluation_probe ( |this, _outer_universe | {
565
+ self . evaluation_probe ( |this| {
566
566
let goal =
567
567
this. infcx . resolve_vars_if_possible ( ( obligation. predicate , obligation. param_env ) ) ;
568
568
let mut result = this. evaluate_predicate_recursively (
@@ -585,11 +585,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
585
585
/// `op`, but this can be overwritten if necessary.
586
586
fn evaluation_probe (
587
587
& mut self ,
588
- op : impl FnOnce ( & mut Self , & mut ty :: UniverseIndex ) -> Result < EvaluationResult , OverflowError > ,
588
+ op : impl FnOnce ( & mut Self ) -> Result < EvaluationResult , OverflowError > ,
589
589
) -> Result < EvaluationResult , OverflowError > {
590
590
self . infcx . probe ( |snapshot| -> Result < EvaluationResult , OverflowError > {
591
- let mut outer_universe = self . infcx . universe ( ) ;
592
- let result = op ( self , & mut outer_universe ) ?;
591
+ let outer_universe = self . infcx . universe ( ) ;
592
+ let result = op ( self ) ?;
593
593
594
594
match self . infcx . leak_check ( outer_universe, Some ( snapshot) ) {
595
595
Ok ( ( ) ) => { }
@@ -1267,9 +1267,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1267
1267
& mut self ,
1268
1268
stack : & TraitObligationStack < ' o , ' tcx > ,
1269
1269
candidate : & SelectionCandidate < ' tcx > ,
1270
- leak_check_higher_ranked_goal : LeakCheckHigherRankedGoal ,
1270
+ _leak_check_higher_ranked_goal : LeakCheckHigherRankedGoal ,
1271
1271
) -> Result < EvaluationResult , OverflowError > {
1272
- let mut result = self . evaluation_probe ( |this, outer_universe | {
1272
+ let mut result = self . evaluation_probe ( |this| {
1273
1273
// We eagerly instantiate higher ranked goals to prevent universe errors
1274
1274
// from impacting candidate selection. This matches the behavior of the new
1275
1275
// solver. This slightly weakens type inference.
@@ -1280,10 +1280,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1280
1280
// in an overlap error in coherence.
1281
1281
let p = self . infcx . enter_forall_and_leak_universe ( stack. obligation . predicate ) ;
1282
1282
let obligation = stack. obligation . with ( this. tcx ( ) , ty:: Binder :: dummy ( p) ) ;
1283
- match leak_check_higher_ranked_goal {
1284
- LeakCheckHigherRankedGoal :: No => * outer_universe = self . infcx . universe ( ) ,
1285
- LeakCheckHigherRankedGoal :: Yes => { }
1286
- }
1287
1283
1288
1284
match this. confirm_candidate ( & obligation, candidate. clone ( ) ) {
1289
1285
Ok ( selection) => {
@@ -1710,13 +1706,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1710
1706
stack : & TraitObligationStack < ' o , ' tcx > ,
1711
1707
where_clause_trait_ref : ty:: PolyTraitRef < ' tcx > ,
1712
1708
) -> Result < EvaluationResult , OverflowError > {
1713
- self . evaluation_probe ( |this, outer_universe | {
1709
+ self . evaluation_probe ( |this| {
1714
1710
// Eagerly instantiate higher ranked goals.
1715
1711
//
1716
1712
// See the comment in `evaluate_candidate` to see why.
1717
1713
let p = self . infcx . enter_forall_and_leak_universe ( stack. obligation . predicate ) ;
1718
1714
let obligation = stack. obligation . with ( this. tcx ( ) , ty:: Binder :: dummy ( p) ) ;
1719
- * outer_universe = self . infcx . universe ( ) ;
1720
1715
match this. match_where_clause_trait_ref ( & obligation, where_clause_trait_ref) {
1721
1716
Ok ( obligations) => this. evaluate_predicates_recursively ( stack. list ( ) , obligations) ,
1722
1717
Err ( ( ) ) => Ok ( EvaluatedToErr ) ,
0 commit comments