Rollup merge of #136484 - Zalathar:query-cache-notes, r=jieyouxu
Notes on types/traits used for in-memory query caching When the word "cache" appears in the context of the query system, it often isn't obvious whether that is referring to the in-memory query cache or the on-disk incremental cache. For these types, we can assure the reader that they are for in-memory caching.
This commit is contained in:
commit
d6f94a683c
4 changed files with 42 additions and 5 deletions
|
@ -20,6 +20,12 @@ pub struct LocalCrate;
|
|||
/// The `Key` trait controls what types can legally be used as the key
|
||||
/// for a query.
|
||||
pub trait Key: Sized {
|
||||
/// The type of in-memory cache to use for queries with this key type.
|
||||
///
|
||||
/// In practice the cache type must implement [`QueryCache`], though that
|
||||
/// constraint is not enforced here.
|
||||
///
|
||||
/// [`QueryCache`]: rustc_query_system::query::QueryCache
|
||||
// N.B. Most of the keys down below have `type Cache<V> = DefaultCache<Self, V>;`,
|
||||
// it would be reasonable to use associated type defaults, to remove the duplication...
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue