Slightly shrink DefMap

This commit is contained in:
Lukas Wirth 2023-06-01 14:46:36 +02:00
parent 117f9b7752
commit dc7c6d43c7
22 changed files with 130 additions and 92 deletions

View file

@ -12,6 +12,7 @@ use crate::{
db::DefDatabase,
dyn_map::{keys, DynMap},
item_scope::ItemScope,
nameres::DefMap,
src::{HasChildSource, HasSource},
AdtId, AssocItemId, DefWithBodyId, EnumId, EnumVariantId, FieldId, ImplId, Lookup, MacroId,
ModuleDefId, ModuleId, TraitId, VariantId,
@ -205,7 +206,7 @@ impl ChildBySource for DefWithBodyId {
for (_, def_map) in body.blocks(db) {
// All block expressions are merged into the same map, because they logically all add
// inner items to the containing `DefWithBodyId`.
def_map[def_map.root()].scope.child_by_source_to(db, res, file_id);
def_map[DefMap::ROOT].scope.child_by_source_to(db, res, file_id);
}
}
}