@@ -199,7 +199,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
199199 // code is so hot. 1 and 0 dominate; 2+ is fairly rare.
200200 1 => {
201201 let infer_var = pending_obligation.stalled_on[0];
202- self.selcx.infcx() .ty_or_const_infer_var_changed(infer_var)
202+ self.selcx.infcx.ty_or_const_infer_var_changed(infer_var)
203203 }
204204 0 => {
205205 // In this case we haven't changed, but wish to make a change.
@@ -210,7 +210,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
210210 // form was a perf win. See #64545 for details.
211211 (|| {
212212 for &infer_var in &pending_obligation.stalled_on {
213- if self.selcx.infcx() .ty_or_const_infer_var_changed(infer_var) {
213+ if self.selcx.infcx.ty_or_const_infer_var_changed(infer_var) {
214214 return true;
215215 }
216216 }
@@ -240,13 +240,12 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
240240 debug!(?obligation, "pre-resolve");
241241
242242 if obligation.predicate.has_non_region_infer() {
243- obligation.predicate =
244- self.selcx.infcx().resolve_vars_if_possible(obligation.predicate);
243+ obligation.predicate = self.selcx.infcx.resolve_vars_if_possible(obligation.predicate);
245244 }
246245
247246 let obligation = &pending_obligation.obligation;
248247
249- let infcx = self.selcx.infcx() ;
248+ let infcx = self.selcx.infcx;
250249
251250 if obligation.predicate.has_projections() {
252251 let mut obligations = Vec::new();
@@ -353,7 +352,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
353352 }
354353
355354 ty::PredicateKind::ClosureKind(_, closure_substs, kind) => {
356- match self.selcx.infcx() .closure_kind(closure_substs) {
355+ match self.selcx.infcx.closure_kind(closure_substs) {
357356 Some(closure_kind) => {
358357 if closure_kind.extends(kind) {
359358 ProcessResult::Changed(vec![])
@@ -367,7 +366,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
367366
368367 ty::PredicateKind::WellFormed(arg) => {
369368 match wf::obligations(
370- self.selcx.infcx() ,
369+ self.selcx.infcx,
371370 obligation.param_env,
372371 obligation.cause.body_id,
373372 obligation.recursion_depth + 1,
@@ -384,7 +383,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
384383 }
385384
386385 ty::PredicateKind::Subtype(subtype) => {
387- match self.selcx.infcx() .subtype_predicate(
386+ match self.selcx.infcx.subtype_predicate(
388387 &obligation.cause,
389388 obligation.param_env,
390389 Binder::dummy(subtype),
@@ -408,7 +407,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
408407 }
409408
410409 ty::PredicateKind::Coerce(coerce) => {
411- match self.selcx.infcx() .coerce_predicate(
410+ match self.selcx.infcx.coerce_predicate(
412411 &obligation.cause,
413412 obligation.param_env,
414413 Binder::dummy(coerce),
@@ -432,7 +431,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
432431
433432 ty::PredicateKind::ConstEvaluatable(uv) => {
434433 match const_evaluatable::is_const_evaluatable(
435- self.selcx.infcx() ,
434+ self.selcx.infcx,
436435 uv,
437436 obligation.param_env,
438437 obligation.cause.span,
@@ -476,7 +475,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
476475
477476 let mut evaluate = |c: Const<'tcx>| {
478477 if let ty::ConstKind::Unevaluated(unevaluated) = c.kind() {
479- match self.selcx.infcx() .try_const_eval_resolve(
478+ match self.selcx.infcx.try_const_eval_resolve(
480479 obligation.param_env,
481480 unevaluated,
482481 c.ty(),
@@ -504,7 +503,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
504503 (Ok(c1), Ok(c2)) => {
505504 match self
506505 .selcx
507- .infcx()
506+ .infcx
508507 .at(&obligation.cause, obligation.param_env)
509508 .eq(c1, c2)
510509 {
@@ -572,7 +571,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
572571 trait_obligation: TraitObligation<'tcx>,
573572 stalled_on: &mut Vec<TyOrConstInferVar<'tcx>>,
574573 ) -> ProcessResult<PendingPredicateObligation<'tcx>, FulfillmentErrorCode<'tcx>> {
575- let infcx = self.selcx.infcx() ;
574+ let infcx = self.selcx.infcx;
576575 if obligation.predicate.is_global() {
577576 // no type variables present, can use evaluation for better caching.
578577 // FIXME: consider caching errors too.
@@ -630,7 +629,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
630629 if obligation.predicate.is_global() {
631630 // no type variables present, can use evaluation for better caching.
632631 // FIXME: consider caching errors too.
633- if self.selcx.infcx() .predicate_must_hold_considering_regions(obligation) {
632+ if self.selcx.infcx.predicate_must_hold_considering_regions(obligation) {
634633 if let Some(key) = ProjectionCacheKey::from_poly_projection_predicate(
635634 &mut self.selcx,
636635 project_obligation.predicate,
@@ -639,7 +638,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
639638 // evaluated all sub-obligations. We can therefore mark the 'root'
640639 // obligation as complete, and skip evaluating sub-obligations.
641640 self.selcx
642- .infcx()
641+ .infcx
643642 .inner
644643 .borrow_mut()
645644 .projection_cache()
@@ -678,7 +677,7 @@ fn substs_infer_vars<'a, 'tcx>(
678677 substs: ty::Binder<'tcx, SubstsRef<'tcx>>,
679678) -> impl Iterator<Item = TyOrConstInferVar<'tcx>> {
680679 selcx
681- .infcx()
680+ .infcx
682681 .resolve_vars_if_possible(substs)
683682 .skip_binder() // ok because this check doesn't care about regions
684683 .iter()
0 commit comments