@@ -102,7 +102,7 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> {
102
102
}
103
103
104
104
/// Attempts to select obligations using `selcx`.
105
- fn select ( & mut self , selcx : & mut SelectionContext < ' a , ' tcx > ) -> Vec < FulfillmentError < ' tcx > > {
105
+ fn select ( & mut self , selcx : SelectionContext < ' a , ' tcx > ) -> Vec < FulfillmentError < ' tcx > > {
106
106
let span = debug_span ! ( "select" , obligation_forest_size = ?self . predicates. len( ) ) ;
107
107
let _enter = span. enter ( ) ;
108
108
@@ -197,8 +197,8 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
197
197
& mut self ,
198
198
infcx : & InferCtxt < ' _ , ' tcx > ,
199
199
) -> Vec < FulfillmentError < ' tcx > > {
200
- let mut selcx = SelectionContext :: new ( infcx) ;
201
- self . select ( & mut selcx)
200
+ let selcx = SelectionContext :: new ( infcx) ;
201
+ self . select ( selcx)
202
202
}
203
203
204
204
fn pending_obligations ( & self ) -> Vec < PredicateObligation < ' tcx > > {
@@ -210,8 +210,8 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
210
210
}
211
211
}
212
212
213
- struct FulfillProcessor < ' a , ' b , ' tcx > {
214
- selcx : & ' a mut SelectionContext < ' b , ' tcx > ,
213
+ struct FulfillProcessor < ' a , ' tcx > {
214
+ selcx : SelectionContext < ' a , ' tcx > ,
215
215
}
216
216
217
217
fn mk_pending ( os : Vec < PredicateObligation < ' _ > > ) -> Vec < PendingPredicateObligation < ' _ > > {
@@ -220,7 +220,7 @@ fn mk_pending(os: Vec<PredicateObligation<'_>>) -> Vec<PendingPredicateObligatio
220
220
. collect ( )
221
221
}
222
222
223
- impl < ' a , ' b , ' tcx > ObligationProcessor for FulfillProcessor < ' a , ' b , ' tcx > {
223
+ impl < ' a , ' tcx > ObligationProcessor for FulfillProcessor < ' a , ' tcx > {
224
224
type Obligation = PendingPredicateObligation < ' tcx > ;
225
225
type Error = FulfillmentErrorCode < ' tcx > ;
226
226
type OUT = Outcome < Self :: Obligation , Self :: Error > ;
@@ -291,7 +291,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
291
291
if obligation. predicate . has_projections ( ) {
292
292
let mut obligations = Vec :: new ( ) ;
293
293
let predicate = crate :: traits:: project:: try_normalize_with_depth_to (
294
- self . selcx ,
294
+ & mut self . selcx ,
295
295
obligation. param_env ,
296
296
obligation. cause . clone ( ) ,
297
297
obligation. recursion_depth + 1 ,
@@ -608,7 +608,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
608
608
}
609
609
}
610
610
611
- impl < ' a , ' b , ' tcx > FulfillProcessor < ' a , ' b , ' tcx > {
611
+ impl < ' a , ' tcx > FulfillProcessor < ' a , ' tcx > {
612
612
#[ instrument( level = "debug" , skip( self , obligation, stalled_on) ) ]
613
613
fn process_trait_obligation (
614
614
& mut self ,
@@ -643,7 +643,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
643
643
// information about the types in the trait.
644
644
stalled_on. clear ( ) ;
645
645
stalled_on. extend ( substs_infer_vars (
646
- self . selcx ,
646
+ & self . selcx ,
647
647
trait_obligation. predicate . map_bound ( |pred| pred. trait_ref . substs ) ,
648
648
) ) ;
649
649
@@ -695,12 +695,12 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
695
695
}
696
696
}
697
697
698
- match project:: poly_project_and_unify_type ( self . selcx , & project_obligation) {
698
+ match project:: poly_project_and_unify_type ( & mut self . selcx , & project_obligation) {
699
699
ProjectAndUnifyResult :: Holds ( os) => ProcessResult :: Changed ( mk_pending ( os) ) ,
700
700
ProjectAndUnifyResult :: FailedNormalization => {
701
701
stalled_on. clear ( ) ;
702
702
stalled_on. extend ( substs_infer_vars (
703
- self . selcx ,
703
+ & self . selcx ,
704
704
project_obligation. predicate . map_bound ( |pred| pred. projection_ty . substs ) ,
705
705
) ) ;
706
706
ProcessResult :: Unchanged
@@ -718,7 +718,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
718
718
719
719
/// Returns the set of inference variables contained in `substs`.
720
720
fn substs_infer_vars < ' a , ' tcx > (
721
- selcx : & mut SelectionContext < ' a , ' tcx > ,
721
+ selcx : & SelectionContext < ' a , ' tcx > ,
722
722
substs : ty:: Binder < ' tcx , SubstsRef < ' tcx > > ,
723
723
) -> impl Iterator < Item = TyOrConstInferVar < ' tcx > > {
724
724
selcx
0 commit comments