aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/eager.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src/eager.rs')
-rw-r--r--crates/hir_expand/src/eager.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs
index e165b9c5f..14af628a1 100644
--- a/crates/hir_expand/src/eager.rs
+++ b/crates/hir_expand/src/eager.rs
@@ -113,6 +113,7 @@ pub fn expand_eager_macro(
113 113
114 let ast_map = db.ast_id_map(macro_call.file_id); 114 let ast_map = db.ast_id_map(macro_call.file_id);
115 let call_id = InFile::new(macro_call.file_id, ast_map.ast_id(&macro_call.value)); 115 let call_id = InFile::new(macro_call.file_id, ast_map.ast_id(&macro_call.value));
116 let fragment = crate::to_fragment_kind(&macro_call.value);
116 117
117 // Note: 118 // Note:
118 // When `lazy_expand` is called, its *parent* file must be already exists. 119 // When `lazy_expand` is called, its *parent* file must be already exists.
@@ -152,7 +153,7 @@ pub fn expand_eager_macro(
152 arg_or_expansion: Arc::new(expanded.subtree), 153 arg_or_expansion: Arc::new(expanded.subtree),
153 included_file: expanded.included_file, 154 included_file: expanded.included_file,
154 }), 155 }),
155 kind: MacroCallKind::FnLike { ast_id: call_id, fragment: expanded.fragment }, 156 kind: MacroCallKind::FnLike { ast_id: call_id, fragment },
156 }; 157 };
157 158
158 Ok(db.intern_macro(loc)) 159 Ok(db.intern_macro(loc))
@@ -197,7 +198,7 @@ fn eager_macro_recur(
197 macro_resolver: &dyn Fn(ast::Path) -> Option<MacroDefId>, 198 macro_resolver: &dyn Fn(ast::Path) -> Option<MacroDefId>,
198 mut diagnostic_sink: &mut dyn FnMut(mbe::ExpandError), 199 mut diagnostic_sink: &mut dyn FnMut(mbe::ExpandError),
199) -> Result<SyntaxNode, ErrorEmitted> { 200) -> Result<SyntaxNode, ErrorEmitted> {
200 let original = curr.value.clone().clone_for_update(); 201 let original = curr.value.clone_for_update();
201 202
202 let children = original.descendants().filter_map(ast::MacroCall::cast); 203 let children = original.descendants().filter_map(ast::MacroCall::cast);
203 let mut replacements = Vec::new(); 204 let mut replacements = Vec::new();