aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-01-28 17:27:27 +0000
committerJonas Schievink <[email protected]>2021-01-28 17:27:27 +0000
commit232b75394e253aeb1fa448b586a2e1ab1e083aa1 (patch)
tree8e5dfa225caa34091939aa05d312b6d4d40e6185 /crates
parent868887ec4e2ad138fcb61a0df2e720771a0f5453 (diff)
Update `original_module` when ascending `DefMap`s
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_def/src/nameres/path_resolution.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir_def/src/nameres/path_resolution.rs b/crates/hir_def/src/nameres/path_resolution.rs
index 419e465ed..2a0f8ec2b 100644
--- a/crates/hir_def/src/nameres/path_resolution.rs
+++ b/crates/hir_def/src/nameres/path_resolution.rs
@@ -103,7 +103,7 @@ impl DefMap {
103 &self, 103 &self,
104 db: &dyn DefDatabase, 104 db: &dyn DefDatabase,
105 mode: ResolveMode, 105 mode: ResolveMode,
106 original_module: LocalModuleId, 106 mut original_module: LocalModuleId,
107 path: &ModPath, 107 path: &ModPath,
108 shadow: BuiltinShadowMode, 108 shadow: BuiltinShadowMode,
109 ) -> ResolvePathResult { 109 ) -> ResolvePathResult {
@@ -130,7 +130,10 @@ impl DefMap {
130 result.segment_index = result.segment_index.min(new.segment_index); 130 result.segment_index = result.segment_index.min(new.segment_index);
131 131
132 match &current_map.block { 132 match &current_map.block {
133 Some(block) => current_map = &block.parent, 133 Some(block) => {
134 current_map = &block.parent;
135 original_module = block.parent_module;
136 }
134 None => return result, 137 None => return result,
135 } 138 }
136 } 139 }