Skip to main content Module caches Copy item path Source use std::sync::OnceLock ; π use rustc_data_structures::sharded::ShardedHashMap ; π use rustc_hir::def_id::LOCAL_CRATE ; π use rustc_index::Idx ; π use rustc_span::def_id::DefId ; π use rustc_span::def_id::DefIndex ; π use crate::dep_graph::DepNodeIndex ; π use crate::query::keys::QueryKey ; π DefIdCache In-memory cache for queries whose key is a DefId . DefaultCache In-memory cache for queries whose keys arenβt suitable for any of the
more specialized kinds of cache. Backed by a sharded hashmap. SingleCache In-memory cache for queries whose key type only has one value (e.g. ()).
The cache therefore only needs to store one query return value. VecCache In-memory cache for queries whose keys are densely-numbered IDs
(e.g CrateNum, LocalDefId), and can therefore be used as indices
into a dense vector of cached values. QueryCache Trait for types that serve as an in-memory cache for query results,
for a given key (argument) type and value (return) type.