about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-03-21 16:38:40 +0100
committerlcnr <rust@lcnr.de>2023-03-21 16:38:40 +0100
commita7ec045be8133fe679c34a7eaba989ca6975d53e (patch)
tree402ed65cf6f70b0054b26e9443d6568967e11b55
parent938434ab82609c8de83028fa80bde4d6d28c282a (diff)
downloadrust-a7ec045be8133fe679c34a7eaba989ca6975d53e.tar.gz
rust-a7ec045be8133fe679c34a7eaba989ca6975d53e.zip
disable global caching during coherence
-rw-r--r--compiler/rustc_trait_selection/src/solve/search_graph/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs b/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
index b94c44cbdd0..219890b9dc4 100644
--- a/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
+++ b/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
@@ -254,7 +254,8 @@ impl<'tcx> SearchGraph<'tcx> {
             // dependencies, our non-root goal may no longer appear as child of the root goal.
             //
             // See https://github.com/rust-lang/rust/pull/108071 for some additional context.
-            let should_cache_globally = !self.overflow_data.did_overflow() || self.stack.is_empty();
+            let should_cache_globally = matches!(self.solver_mode(), SolverMode::Normal)
+                && (!self.overflow_data.did_overflow() || self.stack.is_empty());
             if should_cache_globally {
                 tcx.new_solver_evaluation_cache.insert(
                     current_goal.goal,