aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-02-23 16:56:16 +0000
committerJonas Schievink <[email protected]>2021-02-23 16:56:16 +0000
commit338823f73aefbf7957b928ad76fc5f55cc43df9c (patch)
tree94c3b47b3c8c3bdeb7b52c81825907a33134b67d /crates/hir_def/src/nameres.rs
parentcf456d72dbdc44dfde9b79b632ee952ea161d5c4 (diff)
is_visible_from_def_map: handle block expressions
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r--crates/hir_def/src/nameres.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs
index 34ff07f3c..f92232eb3 100644
--- a/crates/hir_def/src/nameres.rs
+++ b/crates/hir_def/src/nameres.rs
@@ -337,6 +337,12 @@ impl DefMap {
337 None 337 None
338 } 338 }
339 339
340 /// If this `DefMap` is for a block expression, returns the module containing the block (which
341 /// might again be a block, or a module inside a block).
342 pub fn parent(&self) -> Option<ModuleId> {
343 Some(self.block?.parent)
344 }
345
340 // FIXME: this can use some more human-readable format (ideally, an IR 346 // FIXME: this can use some more human-readable format (ideally, an IR
341 // even), as this should be a great debugging aid. 347 // even), as this should be a great debugging aid.
342 pub fn dump(&self, db: &dyn DefDatabase) -> String { 348 pub fn dump(&self, db: &dyn DefDatabase) -> String {