about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits/solve
diff options
context:
space:
mode:
authorBoxy <supbscripter@gmail.com>2023-06-08 19:21:55 +0100
committerBoxy <supbscripter@gmail.com>2023-06-19 09:01:37 +0100
commit3587d4ced8b786e26f7d30f064a8a4d895f545ec (patch)
treef55314bbafa0fad8e7f4ebd798d991fc56bfd206 /compiler/rustc_middle/src/traits/solve
parenta2050ba12d4c717478ec9da176090de1609e8b07 (diff)
say what kind of cache hit
Diffstat (limited to 'compiler/rustc_middle/src/traits/solve')
-rw-r--r--compiler/rustc_middle/src/traits/solve/inspect.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/traits/solve/inspect.rs b/compiler/rustc_middle/src/traits/solve/inspect.rs
index 8cbdb493ccd..6060e8f3546 100644
--- a/compiler/rustc_middle/src/traits/solve/inspect.rs
+++ b/compiler/rustc_middle/src/traits/solve/inspect.rs
@@ -3,6 +3,12 @@ use crate::ty;
 use std::fmt::{Debug, Write};
 
 #[derive(Eq, PartialEq, Hash, HashStable)]
+pub enum CacheHit {
+    Provisional,
+    Global,
+}
+
+#[derive(Eq, PartialEq, Hash, HashStable)]
 pub struct GoalEvaluation<'tcx> {
     pub uncanonicalized_goal: Goal<'tcx, ty::Predicate<'tcx>>,
     pub canonicalized_goal: Option<CanonicalInput<'tcx>>,
@@ -12,7 +18,7 @@ pub struct GoalEvaluation<'tcx> {
     /// is represented as an entry in this vec.
     pub evaluation_steps: Vec<GoalEvaluationStep<'tcx>>,
 
-    pub cache_hit: bool,
+    pub cache_hit: Option<CacheHit>,
 
     pub result: Option<QueryResult<'tcx>>,
 }
@@ -92,8 +98,9 @@ impl ProofTreeFormatter<'_, '_> {
         writeln!(f, "CANONICALIZED: {:?}", goal.canonicalized_goal)?;
 
         match goal.cache_hit {
-            true => writeln!(f, "CACHE HIT: {:?}", goal.result),
-            false => {
+            Some(CacheHit::Global) => writeln!(f, "GLOBAL CACHE HIT: {:?}", goal.result),
+            Some(CacheHit::Provisional) => writeln!(f, "PROVISIONAL CACHE HIT: {:?}", goal.result),
+            None => {
                 for (n, step) in goal.evaluation_steps.iter().enumerate() {
                     let f = &mut *self.f;
                     writeln!(f, "REVISION {n}: {:?}", step.result.unwrap())?;