summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-10-31 16:08:09 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-01 17:02:51 +0000
commitaee4d132e75b5dbd22d98299c0c373cd92b08749 (patch)
tree71d3254b9ae6ba270f3767712eecdffca043be93 /compiler/rustc_query_system
parent07f19480438e290cab41c3b61478ba993c284824 (diff)
downloadrust-aee4d132e75b5dbd22d98299c0c373cd92b08749.tar.gz
rust-aee4d132e75b5dbd22d98299c0c373cd92b08749.zip
Remove CacheSelector.
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/query/caches.rs17
-rw-r--r--compiler/rustc_query_system/src/query/mod.rs4
2 files changed, 1 insertions, 20 deletions
diff --git a/compiler/rustc_query_system/src/query/caches.rs b/compiler/rustc_query_system/src/query/caches.rs
index 85c5af72ef5..51b30a9f36a 100644
--- a/compiler/rustc_query_system/src/query/caches.rs
+++ b/compiler/rustc_query_system/src/query/caches.rs
@@ -11,11 +11,6 @@ use rustc_data_structures::sync::WorkerLocal;
 use std::default::Default;
 use std::fmt::Debug;
 use std::hash::Hash;
-use std::marker::PhantomData;
-
-pub trait CacheSelector<K, V> {
-    type Cache;
-}
 
 pub trait QueryStorage {
     type Value: Debug;
@@ -47,12 +42,6 @@ pub trait QueryCache: QueryStorage + Sized {
     fn iter(&self, f: &mut dyn FnMut(&Self::Key, &Self::Value, DepNodeIndex));
 }
 
-pub struct DefaultCacheSelector;
-
-impl<K: Eq + Hash, V: Clone> CacheSelector<K, V> for DefaultCacheSelector {
-    type Cache = DefaultCache<K, V>;
-}
-
 pub struct DefaultCache<K, V> {
     #[cfg(parallel_compiler)]
     cache: Sharded<FxHashMap<K, (V, DepNodeIndex)>>,
@@ -134,12 +123,6 @@ where
     }
 }
 
-pub struct ArenaCacheSelector<'tcx>(PhantomData<&'tcx ()>);
-
-impl<'tcx, K: Eq + Hash, V: 'tcx> CacheSelector<K, V> for ArenaCacheSelector<'tcx> {
-    type Cache = ArenaCache<'tcx, K, V>;
-}
-
 pub struct ArenaCache<'tcx, K, V> {
     arena: WorkerLocal<TypedArena<(V, DepNodeIndex)>>,
     #[cfg(parallel_compiler)]
diff --git a/compiler/rustc_query_system/src/query/mod.rs b/compiler/rustc_query_system/src/query/mod.rs
index 118703fc0d4..247d55be531 100644
--- a/compiler/rustc_query_system/src/query/mod.rs
+++ b/compiler/rustc_query_system/src/query/mod.rs
@@ -7,9 +7,7 @@ pub use self::job::deadlock;
 pub use self::job::{print_query_stack, QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryMap};
 
 mod caches;
-pub use self::caches::{
-    ArenaCacheSelector, CacheSelector, DefaultCacheSelector, QueryCache, QueryStorage,
-};
+pub use self::caches::{ArenaCache, DefaultCache, QueryCache, QueryStorage};
 
 mod config;
 pub use self::config::{QueryConfig, QueryDescription, QueryVTable};