aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-02 10:47:22 +0000
committerGitHub <[email protected]>2021-02-02 10:47:22 +0000
commit157156276b32c4edca337e6389dc70a203c7c681 (patch)
tree4424b450134591652648d4709715655975fe3ba7 /crates/hir_def/src/nameres.rs
parent3c1fcfcd1b79430c1ea97eea4ce0c89c9c793cdb (diff)
parent7202ce6c963f047b8890ee50acc5aaf5d65f175d (diff)
Merge #7516
7516: Revert "Use block_def_map in body lowering" r=jonas-schievink a=jonas-schievink Reverts rust-analyzer/rust-analyzer#7506 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r--crates/hir_def/src/nameres.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs
index 9839761d1..6169b3bbc 100644
--- a/crates/hir_def/src/nameres.rs
+++ b/crates/hir_def/src/nameres.rs
@@ -201,10 +201,8 @@ impl DefMap {
201 let block: BlockLoc = db.lookup_intern_block(block_id); 201 let block: BlockLoc = db.lookup_intern_block(block_id);
202 let parent = block.module.def_map(db); 202 let parent = block.module.def_map(db);
203 203
204 let item_tree = db.item_tree(block.ast_id.file_id); 204 // FIXME: It would be good to just return the parent map when the block has no items, but
205 if item_tree.inner_items_of_block(block.ast_id.value).is_empty() { 205 // we rely on `def_map.block` in a few places, which is `Some` for the inner `DefMap`.
206 return parent.clone();
207 }
208 206
209 let block_info = 207 let block_info =
210 BlockInfo { block: block_id, parent, parent_module: block.module.local_id }; 208 BlockInfo { block: block_id, parent, parent_module: block.module.local_id };