Skip to content

Commit d305b2c

Browse files
committed
Unify key types in get_lookup.
1 parent 301ad11 commit d305b2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_query_system/query/caches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use std::default::Default;
88
use std::hash::Hash;
99
use std::marker::PhantomData;
1010

11-
pub trait CacheSelector<CTX: QueryContext, K, V> {
11+
pub trait CacheSelector<CTX: QueryContext, K: Hash, V> {
1212
type Cache: QueryCache<CTX, Key = K, Value = V>;
1313
}
1414

1515
pub trait QueryCache<CTX: QueryContext>: Default {
16-
type Key;
16+
type Key: Hash;
1717
type Value;
1818
type Sharded: Default;
1919

src/librustc_query_system/query/plumbing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ pub struct QueryState<CTX: QueryContext, C: QueryCache<CTX>> {
5757
}
5858

5959
impl<CTX: QueryContext, C: QueryCache<CTX>> QueryState<CTX, C> {
60-
pub(super) fn get_lookup<'tcx, K2: Hash>(
60+
pub(super) fn get_lookup<'tcx>(
6161
&'tcx self,
62-
key: &K2,
62+
key: &C::Key,
6363
) -> QueryLookup<'tcx, CTX, C::Key, C::Sharded> {
6464
// We compute the key's hash once and then use it for both the
6565
// shard lookup and the hashmap lookup. This relies on the fact

0 commit comments

Comments
 (0)