Skip to content

Commit 1d8489c

Browse files
author
Markus Westerlind
committed
perf: Revert accidental inclusion of a part of #69218
This was accidentally included in #69494 after a rebase and given how much `inflate` and `keccak` stresses the obligation forest seems like a likely culprit to the regression in those benchmarks. (It is necessary in #69218 as obligation forest needs to accurately track the root variables or unifications will get lost)
1 parent 97f3eee commit 1d8489c

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/librustc_trait_selection/traits/fulfill.rs

+6-12
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,9 @@ struct FulfillProcessor<'a, 'b, 'tcx> {
240240
register_region_obligations: bool,
241241
}
242242

243-
fn mk_pending(
244-
infcx: &InferCtxt<'_, 'tcx>,
245-
os: Vec<PredicateObligation<'tcx>>,
246-
) -> Vec<PendingPredicateObligation<'tcx>> {
243+
fn mk_pending(os: Vec<PredicateObligation<'tcx>>) -> Vec<PendingPredicateObligation<'tcx>> {
247244
os.into_iter()
248-
.map(|mut o| {
249-
o.predicate = infcx.resolve_vars_if_possible(&o.predicate);
250-
PendingPredicateObligation { obligation: o, stalled_on: vec![] }
251-
})
245+
.map(|o| PendingPredicateObligation { obligation: o, stalled_on: vec![] })
252246
.collect()
253247
}
254248

@@ -342,7 +336,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
342336
"selecting trait `{:?}` at depth {} yielded Ok(Some)",
343337
data, obligation.recursion_depth
344338
);
345-
ProcessResult::Changed(mk_pending(infcx, vtable.nested_obligations()))
339+
ProcessResult::Changed(mk_pending(vtable.nested_obligations()))
346340
}
347341
Ok(None) => {
348342
debug!(
@@ -436,7 +430,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
436430
trait_ref_type_vars(self.selcx, data.to_poly_trait_ref(tcx));
437431
ProcessResult::Unchanged
438432
}
439-
Ok(Some(os)) => ProcessResult::Changed(mk_pending(infcx, os)),
433+
Ok(Some(os)) => ProcessResult::Changed(mk_pending(os)),
440434
Err(e) => ProcessResult::Error(CodeProjectionError(e)),
441435
}
442436
}
@@ -475,7 +469,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
475469
vec![TyOrConstInferVar::maybe_from_ty(ty).unwrap()];
476470
ProcessResult::Unchanged
477471
}
478-
Some(os) => ProcessResult::Changed(mk_pending(infcx, os)),
472+
Some(os) => ProcessResult::Changed(mk_pending(os)),
479473
}
480474
}
481475

@@ -493,7 +487,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
493487
];
494488
ProcessResult::Unchanged
495489
}
496-
Some(Ok(ok)) => ProcessResult::Changed(mk_pending(infcx, ok.obligations)),
490+
Some(Ok(ok)) => ProcessResult::Changed(mk_pending(ok.obligations)),
497491
Some(Err(err)) => {
498492
let expected_found = ExpectedFound::new(
499493
subtype.skip_binder().a_is_expected,

0 commit comments

Comments
 (0)