Skip to content

Commit af3d6a4

Browse files
Include macro path in eager macro resolve error
1 parent e6b64fd commit af3d6a4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/hir_expand/src/eager.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,13 @@ fn eager_macro_recur(
204204

205205
// Collect replacement
206206
for child in children {
207-
let def = diagnostic_sink
208-
.option_with(|| macro_resolver(child.path()?), || err("failed to resolve macro"))?;
207+
let def = diagnostic_sink.option_with(
208+
|| macro_resolver(child.path()?),
209+
|| {
210+
let path = child.path().map(|path| format!(" `{}!`", path)).unwrap_or_default();
211+
err(format!("failed to resolve macro{}", path))
212+
},
213+
)?;
209214
let insert = match def.kind {
210215
MacroDefKind::BuiltInEager(..) => {
211216
let id = expand_eager_macro(

0 commit comments

Comments
 (0)