Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/semantics/child_by_source.rs')
| -rw-r--r-- | crates/hir/src/semantics/child_by_source.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir/src/semantics/child_by_source.rs b/crates/hir/src/semantics/child_by_source.rs index 165ac7e4a0..d924aaa25d 100644 --- a/crates/hir/src/semantics/child_by_source.rs +++ b/crates/hir/src/semantics/child_by_source.rs @@ -20,7 +20,6 @@ use hir_def::{ }, hir::generics::GenericParams, item_scope::ItemScope, - nameres::DefMap, src::{HasChildSource, HasSource}, }; @@ -87,7 +86,7 @@ impl ChildBySource for ImplId { impl ChildBySource for ModuleId { fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId) { let def_map = self.def_map(db); - let module_data = &def_map[self.local_id]; + let module_data = &def_map[*self]; module_data.scope.child_by_source_to(db, res, file_id); } } @@ -226,8 +225,8 @@ impl ChildBySource for DefWithBodyId { for (block, 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[DefMap::ROOT].scope.child_by_source_to(db, res, file_id); - res[keys::BLOCK].insert(block.lookup(db).ast_id.to_ptr(db), block); + def_map[def_map.root].scope.child_by_source_to(db, res, file_id); + res[keys::BLOCK].insert(block.ast_id(db).to_ptr(db), block); } } } |