about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src/query/config.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-02-06 13:49:08 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2021-02-13 21:14:58 +0100
commit15b0bc6b8380942fb45f1839b9fd91e66fad8045 (patch)
tree6491b4d4bae653079332cb01f76e76188728638e /compiler/rustc_query_system/src/query/config.rs
parent9f46259a7516f0bc453f9a0edb318be11c3d4a28 (diff)
downloadrust-15b0bc6b8380942fb45f1839b9fd91e66fad8045.tar.gz
rust-15b0bc6b8380942fb45f1839b9fd91e66fad8045.zip
Separate the query cache from the query state.
Diffstat (limited to 'compiler/rustc_query_system/src/query/config.rs')
-rw-r--r--compiler/rustc_query_system/src/query/config.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_query_system/src/query/config.rs b/compiler/rustc_query_system/src/query/config.rs
index 94e906fc433..fecd75049fb 100644
--- a/compiler/rustc_query_system/src/query/config.rs
+++ b/compiler/rustc_query_system/src/query/config.rs
@@ -4,7 +4,7 @@ use crate::dep_graph::DepNode;
 use crate::dep_graph::SerializedDepNodeIndex;
 use crate::query::caches::QueryCache;
 use crate::query::plumbing::CycleError;
-use crate::query::{QueryContext, QueryState};
+use crate::query::{QueryCacheStore, QueryContext, QueryState};
 
 use rustc_data_structures::fingerprint::Fingerprint;
 use std::fmt::Debug;
@@ -73,7 +73,12 @@ pub trait QueryAccessors<CTX: QueryContext>: QueryConfig {
     type Cache: QueryCache<Key = Self::Key, Stored = Self::Stored, Value = Self::Value>;
 
     // Don't use this method to access query results, instead use the methods on TyCtxt
-    fn query_state<'a>(tcx: CTX) -> &'a QueryState<CTX::DepKind, CTX::Query, Self::Cache>;
+    fn query_state<'a>(tcx: CTX) -> &'a QueryState<CTX::DepKind, CTX::Query, Self::Key>;
+
+    // Don't use this method to access query results, instead use the methods on TyCtxt
+    fn query_cache<'a>(tcx: CTX) -> &'a QueryCacheStore<Self::Cache>
+    where
+        CTX: 'a;
 
     fn to_dep_node(tcx: CTX, key: &Self::Key) -> DepNode<CTX::DepKind>
     where