Skip to content

Commit 2117ba0

Browse files
Merge #10331
10331: minor: Include macro path in eager macro resolve error r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
2 parents ef3a260 + af3d6a4 commit 2117ba0

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)