Unnamed repository; edit this file 'description' to name the repository.
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]>
bors[bot] 2021-09-24
parent ef3a260 · parent af3d6a4 · commit 2117ba0
-rw-r--r--crates/hir_expand/src/eager.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs
index ac87c51023..b78d740c53 100644
--- a/crates/hir_expand/src/eager.rs
+++ b/crates/hir_expand/src/eager.rs
@@ -204,8 +204,13 @@ fn eager_macro_recur(
// Collect replacement
for child in children {
- let def = diagnostic_sink
- .option_with(|| macro_resolver(child.path()?), || err("failed to resolve macro"))?;
+ let def = diagnostic_sink.option_with(
+ || macro_resolver(child.path()?),
+ || {
+ let path = child.path().map(|path| format!(" `{}!`", path)).unwrap_or_default();
+ err(format!("failed to resolve macro{}", path))
+ },
+ )?;
let insert = match def.kind {
MacroDefKind::BuiltInEager(..) => {
let id = expand_eager_macro(