diff --git a/crates/proc_macro_srv/src/lib.rs b/crates/proc_macro_srv/src/lib.rs index 6e890f8e28..9cca969944 100644 --- a/crates/proc_macro_srv/src/lib.rs +++ b/crates/proc_macro_srv/src/lib.rs @@ -40,7 +40,8 @@ impl ProcMacroSrv { match expander.expand(&task.macro_name, &task.macro_body, task.attributes.as_ref()) { Ok(expansion) => Ok(ExpansionResult { expansion }), Err(msg) => { - Err(format!("Cannot perform expansion for {}: error {:?}", &task.macro_name, msg)) + let msg = msg.as_str().unwrap_or(""); + Err(format!("proc-macro panicked: {}", msg)) } } }