Turn macro_expand from query to normal function

This commit is contained in:
Lukas Wirth 2023-11-28 16:50:05 +01:00
parent b98597f06d
commit 7a8c4c001b
12 changed files with 15 additions and 36 deletions

View file

@ -157,7 +157,6 @@ impl RootDatabase {
base_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
// macro expansions are usually rather small, so we can afford to keep more of them alive
hir::db::ParseMacroExpansionQuery.in_db_mut(self).set_lru_capacity(4 * lru_capacity);
hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(4 * lru_capacity);
}
pub fn update_lru_capacities(&mut self, lru_capacities: &FxHashMap<Box<str>, usize>) {
@ -175,12 +174,6 @@ impl RootDatabase {
.copied()
.unwrap_or(4 * base_db::DEFAULT_PARSE_LRU_CAP),
);
hir_db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(
lru_capacities
.get(stringify!(MacroExpandQuery))
.copied()
.unwrap_or(4 * base_db::DEFAULT_PARSE_LRU_CAP),
);
macro_rules! update_lru_capacity_per_query {
($( $module:ident :: $query:ident )*) => {$(