diff --git a/src/librustc_query_system/query/caches.rs b/src/librustc_query_system/query/caches.rs index efde51c4db6..400e6fe84a8 100644 --- a/src/librustc_query_system/query/caches.rs +++ b/src/librustc_query_system/query/caches.rs @@ -8,12 +8,12 @@ use std::default::Default; use std::hash::Hash; use std::marker::PhantomData; -pub trait CacheSelector { +pub trait CacheSelector { type Cache: QueryCache; } pub trait QueryCache: Default { - type Key; + type Key: Hash; type Value; type Sharded: Default; diff --git a/src/librustc_query_system/query/plumbing.rs b/src/librustc_query_system/query/plumbing.rs index 6fd86d65c1d..dbe7b9c385d 100644 --- a/src/librustc_query_system/query/plumbing.rs +++ b/src/librustc_query_system/query/plumbing.rs @@ -57,9 +57,9 @@ pub struct QueryState> { } impl> QueryState { - pub(super) fn get_lookup<'tcx, K2: Hash>( + pub(super) fn get_lookup<'tcx>( &'tcx self, - key: &K2, + key: &C::Key, ) -> QueryLookup<'tcx, CTX, C::Key, C::Sharded> { // We compute the key's hash once and then use it for both the // shard lookup and the hashmap lookup. This relies on the fact