]> git.lizzy.rs Git - rust.git/commitdiff
Unpack type arguments for QueryLookup.
authorCamille GILLOT <gillot.camille@gmail.com>
Fri, 6 Mar 2020 18:54:19 +0000 (19:54 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Mon, 16 Mar 2020 08:36:28 +0000 (09:36 +0100)
src/librustc/ty/query/plumbing.rs

index b688365b2bb9ad0a85046a7441b1737b1ab497fc..67f0fdfcd5488aea9e21828bfa543fa213dbeb23 100644 (file)
@@ -74,7 +74,7 @@ pub(super) fn get_lookup<K: Hash>(&'tcx self, key: &K) -> QueryLookup<'tcx, Q> {
 
         let shard = self.shards.get_shard_index_by_hash(key_hash);
         let lock = self.shards.get_shard_by_index(shard).lock();
-        QueryLookup { key_hash, shard, lock }
+        QueryLookupImpl { key_hash, shard, lock }
     }
 }
 
@@ -115,10 +115,11 @@ fn default() -> QueryState<'tcx, M> {
 }
 
 /// Values used when checking a query cache which can be reused on a cache-miss to execute the query.
-pub(crate) struct QueryLookup<'tcx, Q: QueryAccessors<'tcx>> {
+pub(crate) type QueryLookup<'tcx, Q> = QueryLookupImpl<'tcx, QueryStateShard<'tcx, Q>>;
+pub(crate) struct QueryLookupImpl<'tcx, QSS> {
     pub(super) key_hash: u64,
     pub(super) shard: usize,
-    pub(super) lock: LockGuard<'tcx, QueryStateShard<'tcx, Q>>,
+    pub(super) lock: LockGuard<'tcx, QSS>,
 }
 
 /// A type representing the responsibility to execute the job in the `job` field.