|
1 | 1 | use crate::dep_graph::DepNodeIndex; |
2 | | -use crate::query::plumbing::{QueryLookup, QueryState}; |
| 2 | +use crate::query::plumbing::{QueryCacheStore, QueryLookup}; |
3 | 3 |
|
4 | 4 | use rustc_arena::TypedArena; |
5 | 5 | use rustc_data_structures::fx::FxHashMap; |
@@ -31,13 +31,13 @@ pub trait QueryCache: QueryStorage { |
31 | 31 | /// It returns the shard index and a lock guard to the shard, |
32 | 32 | /// which will be used if the query is not in the cache and we need |
33 | 33 | /// to compute it. |
34 | | - fn lookup<'s, D, Q, R, OnHit>( |
| 34 | + fn lookup<'s, R, OnHit>( |
35 | 35 | &self, |
36 | | - state: &'s QueryState<D, Q, Self>, |
| 36 | + state: &'s QueryCacheStore<Self>, |
37 | 37 | key: &Self::Key, |
38 | 38 | // `on_hit` can be called while holding a lock to the query state shard. |
39 | 39 | on_hit: OnHit, |
40 | | - ) -> Result<R, QueryLookup<'s, D, Q, Self::Key, Self::Sharded>> |
| 40 | + ) -> Result<R, QueryLookup<'s, Self::Sharded>> |
41 | 41 | where |
42 | 42 | OnHit: FnOnce(&Self::Stored, DepNodeIndex) -> R; |
43 | 43 |
|
@@ -93,17 +93,17 @@ where |
93 | 93 | type Sharded = FxHashMap<K, (V, DepNodeIndex)>; |
94 | 94 |
|
95 | 95 | #[inline(always)] |
96 | | - fn lookup<'s, D, Q, R, OnHit>( |
| 96 | + fn lookup<'s, R, OnHit>( |
97 | 97 | &self, |
98 | | - state: &'s QueryState<D, Q, Self>, |
| 98 | + state: &'s QueryCacheStore<Self>, |
99 | 99 | key: &K, |
100 | 100 | on_hit: OnHit, |
101 | | - ) -> Result<R, QueryLookup<'s, D, Q, K, Self::Sharded>> |
| 101 | + ) -> Result<R, QueryLookup<'s, Self::Sharded>> |
102 | 102 | where |
103 | 103 | OnHit: FnOnce(&V, DepNodeIndex) -> R, |
104 | 104 | { |
105 | 105 | let lookup = state.get_lookup(key); |
106 | | - let result = lookup.lock.cache.raw_entry().from_key_hashed_nocheck(lookup.key_hash, key); |
| 106 | + let result = lookup.lock.raw_entry().from_key_hashed_nocheck(lookup.key_hash, key); |
107 | 107 |
|
108 | 108 | if let Some((_, value)) = result { |
109 | 109 | let hit_result = on_hit(&value.0, value.1); |
@@ -176,17 +176,17 @@ where |
176 | 176 | type Sharded = FxHashMap<K, &'tcx (V, DepNodeIndex)>; |
177 | 177 |
|
178 | 178 | #[inline(always)] |
179 | | - fn lookup<'s, D, Q, R, OnHit>( |
| 179 | + fn lookup<'s, R, OnHit>( |
180 | 180 | &self, |
181 | | - state: &'s QueryState<D, Q, Self>, |
| 181 | + state: &'s QueryCacheStore<Self>, |
182 | 182 | key: &K, |
183 | 183 | on_hit: OnHit, |
184 | | - ) -> Result<R, QueryLookup<'s, D, Q, K, Self::Sharded>> |
| 184 | + ) -> Result<R, QueryLookup<'s, Self::Sharded>> |
185 | 185 | where |
186 | 186 | OnHit: FnOnce(&&'tcx V, DepNodeIndex) -> R, |
187 | 187 | { |
188 | 188 | let lookup = state.get_lookup(key); |
189 | | - let result = lookup.lock.cache.raw_entry().from_key_hashed_nocheck(lookup.key_hash, key); |
| 189 | + let result = lookup.lock.raw_entry().from_key_hashed_nocheck(lookup.key_hash, key); |
190 | 190 |
|
191 | 191 | if let Some((_, value)) = result { |
192 | 192 | let hit_result = on_hit(&&value.0, value.1); |
|
0 commit comments