Skip to content

Commit aa1f051

Browse files
Swich DefIdCache to use LocalDefId for local caching
This should hopefully share monomorphizations with DefIndex, helping speed up bootstrap time and maybe reduce binary sizes.
1 parent aa57e46 commit aa1f051

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_query_system/src/query

1 file changed

+2
-2
lines changed

compiler/rustc_query_system/src/query/caches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::OnceLock;
44

55
use rustc_data_structures::sharded::ShardedHashMap;
66
pub use rustc_data_structures::vec_cache::VecCache;
7-
use rustc_hir::def_id::LOCAL_CRATE;
7+
use rustc_hir::def_id::{LOCAL_CRATE, LocalDefId};
88
use rustc_index::Idx;
99
use rustc_span::def_id::{DefId, DefIndex};
1010

@@ -116,7 +116,7 @@ where
116116
pub struct DefIdCache<V> {
117117
/// Stores the local DefIds in a dense map. Local queries are much more often dense, so this is
118118
/// a win over hashing query keys at marginal memory cost (~5% at most) compared to FxHashMap.
119-
local: VecCache<DefIndex, V, DepNodeIndex>,
119+
local: VecCache<LocalDefId, V, DepNodeIndex>,
120120
foreign: DefaultCache<DefId, V>,
121121
}
122122

0 commit comments

Comments
 (0)