add flag for disabling global cache and printing proof trees on error

This commit is contained in:
Boxy
2023-07-03 21:00:10 +01:00
parent 8931edf746
commit 040aa58d0a
8 changed files with 175 additions and 48 deletions

View File

@@ -13,6 +13,7 @@ use rustc_middle::traits::solve::{CanonicalInput, Certainty, MaybeCause, QueryRe
use rustc_middle::ty::TyCtxt;
use std::{collections::hash_map::Entry, mem};
use super::eval_ctxt::DisableGlobalCache;
use super::inspect::ProofTreeBuilder;
use super::SolverMode;
@@ -213,7 +214,9 @@ impl<'tcx> SearchGraph<'tcx> {
inspect: &mut ProofTreeBuilder<'tcx>,
mut loop_body: impl FnMut(&mut Self, &mut ProofTreeBuilder<'tcx>) -> QueryResult<'tcx>,
) -> QueryResult<'tcx> {
if self.should_use_global_cache() {
if self.should_use_global_cache()
&& inspect.disable_global_cache() == DisableGlobalCache::No
{
if let Some(result) = tcx.new_solver_evaluation_cache.get(&canonical_input, tcx) {
debug!(?canonical_input, ?result, "cache hit");
inspect.cache_hit(CacheHit::Global);