Skip to content

Commit e3175c3

Browse files
committed
Auto merge of #61754 - nikomatsakis:trait-caching-perf-3, r=pnkfelix
create a "provisional cache" to restore performance in the case of cycles Introduce a "provisional cache" that caches the results of auto trait resolutions but keeps them from entering the *main* cache until everything is ready. This turned out a bit more complex than I hoped, but I don't see another short term fix -- happy to take suggestions! In the meantime, it's very clear we need to rework the trait solver. This resolves the extreme performance slowdown experienced in #60846 -- I plan to add a perf.rust-lang.org regression test to track this. Caveat: I've not run `x.py test` in full yet. r? @pnkfelix cc @arielb1 Fixes #60846
2 parents 37b6a5e + 0baa925 commit e3175c3

File tree

4 files changed

+409
-85
lines changed

4 files changed

+409
-85
lines changed

src/librustc/traits/query/evaluate_obligation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
6464
Err(OverflowError) => {
6565
let mut selcx =
6666
SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
67-
selcx.evaluate_obligation_recursively(obligation)
67+
selcx.evaluate_root_obligation(obligation)
6868
.unwrap_or_else(|r| {
6969
span_bug!(
7070
obligation.cause.span,

0 commit comments

Comments
 (0)