diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-21 17:57:45 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-21 17:57:45 +0000 |
commit | 31ed1641615bd57d9f4897dbe93e97f185fc5273 (patch) | |
tree | c1b252604b48d2379c4735b535deaec9489d2d1a /crates/hir_expand/src/eager.rs | |
parent | 35868c4f7dc479dd5f731a2785ec6a203046ea9c (diff) | |
parent | 7b693470c4fc61fff08c435cc3a2a646e88678cb (diff) |
Merge #8134
8134: Correct the paths of submodules from the include! macro r=edwin0cheng a=sticnarf
This PR should fix #7846. It mostly follows the instructions from @edwin0cheng in that issue.
Co-authored-by: Yilin Chen <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/eager.rs')
-rw-r--r-- | crates/hir_expand/src/eager.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs index 04f374a29..9eedc8461 100644 --- a/crates/hir_expand/src/eager.rs +++ b/crates/hir_expand/src/eager.rs | |||
@@ -124,6 +124,7 @@ pub fn expand_eager_macro( | |||
124 | subtree: Arc::new(parsed_args.clone()), | 124 | subtree: Arc::new(parsed_args.clone()), |
125 | krate, | 125 | krate, |
126 | call: call_id, | 126 | call: call_id, |
127 | included_file: None, | ||
127 | } | 128 | } |
128 | }); | 129 | }); |
129 | let arg_file_id: MacroCallId = arg_id.into(); | 130 | let arg_file_id: MacroCallId = arg_id.into(); |
@@ -143,9 +144,15 @@ pub fn expand_eager_macro( | |||
143 | if let MacroDefKind::BuiltInEager(eager, _) = def.kind { | 144 | if let MacroDefKind::BuiltInEager(eager, _) = def.kind { |
144 | let res = eager.expand(db, arg_id, &subtree); | 145 | let res = eager.expand(db, arg_id, &subtree); |
145 | 146 | ||
146 | let (subtree, fragment) = diagnostic_sink.expand_result_option(res)?; | 147 | let expanded = diagnostic_sink.expand_result_option(res)?; |
147 | let eager = | 148 | let eager = EagerCallLoc { |
148 | EagerCallLoc { def, fragment, subtree: Arc::new(subtree), krate, call: call_id }; | 149 | def, |
150 | fragment: expanded.fragment, | ||
151 | subtree: Arc::new(expanded.subtree), | ||
152 | krate, | ||
153 | call: call_id, | ||
154 | included_file: expanded.included_file, | ||
155 | }; | ||
149 | 156 | ||
150 | Ok(db.intern_eager_expansion(eager)) | 157 | Ok(db.intern_eager_expansion(eager)) |
151 | } else { | 158 | } else { |