diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-28 17:28:58 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-28 17:28:58 +0000 |
commit | 00b9b2d6458d20e15e602e659cafe6c09765c5ae (patch) | |
tree | 8e5dfa225caa34091939aa05d312b6d4d40e6185 /crates/hir_def/src/nameres | |
parent | 868887ec4e2ad138fcb61a0df2e720771a0f5453 (diff) | |
parent | 232b75394e253aeb1fa448b586a2e1ab1e083aa1 (diff) |
Merge #7481
7481: Update `original_module` when ascending `DefMap`s r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres')
-rw-r--r-- | crates/hir_def/src/nameres/path_resolution.rs | 7 |
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 ¤t_map.block { | 132 | match ¤t_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 | } |