Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/child_by_source.rs')
| -rw-r--r-- | crates/hir-def/src/child_by_source.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir-def/src/child_by_source.rs b/crates/hir-def/src/child_by_source.rs index ba7d06272a..f1c6b3b89f 100644 --- a/crates/hir-def/src/child_by_source.rs +++ b/crates/hir-def/src/child_by_source.rs @@ -189,10 +189,11 @@ impl ChildBySource for DefWithBodyId { VariantId::EnumVariantId(v).child_by_source_to(db, res, file_id) } - for (_, def_map) in body.blocks(db) { + 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_node(db.upcast()), block); } } } |