aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/child_by_source.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-04 02:04:44 +0100
committerGitHub <[email protected]>2021-04-04 02:04:44 +0100
commit4c8ee9a53190917f9171a3272c8061d926c2fcbe (patch)
tree90bb5a1a7917695ae540ff8c2056b7b9c29ddcfd /crates/hir_def/src/child_by_source.rs
parent6b43a518e6d12868ddd749c8ebead343ba823f5b (diff)
parentd8bf9bef800969304440fd2a2a324606a342eaa2 (diff)
Merge #8322
8322: Access a body's block def maps via a method r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/child_by_source.rs')
-rw-r--r--crates/hir_def/src/child_by_source.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_def/src/child_by_source.rs b/crates/hir_def/src/child_by_source.rs
index 2a331dcaf..f40a7f80d 100644
--- a/crates/hir_def/src/child_by_source.rs
+++ b/crates/hir_def/src/child_by_source.rs
@@ -160,7 +160,7 @@ impl ChildBySource for EnumId {
160impl ChildBySource for DefWithBodyId { 160impl ChildBySource for DefWithBodyId {
161 fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) { 161 fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
162 let body = db.body(*self); 162 let body = db.body(*self);
163 for def_map in body.block_scopes.iter().filter_map(|block| db.block_def_map(*block)) { 163 for (_, def_map) in body.blocks(db) {
164 // All block expressions are merged into the same map, because they logically all add 164 // All block expressions are merged into the same map, because they logically all add
165 // inner items to the containing `DefWithBodyId`. 165 // inner items to the containing `DefWithBodyId`.
166 def_map[def_map.root()].scope.child_by_source_to(db, res); 166 def_map[def_map.root()].scope.child_by_source_to(db, res);