aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-08 18:47:10 +0000
committerGitHub <[email protected]>2020-12-08 18:47:10 +0000
commit70fa57f8d30c80927465de9a1b8501d7a2ee4925 (patch)
treebc5920801a0c7ca9e3ffd7502be1e88040f06fe8
parentb3ceee2a2764a64318d16708a3ce2d281611bd26 (diff)
parent6c4d5164d9d1c6751f2c63612ad5f68f1eef3a1b (diff)
Merge #6767
6767: Better error when a proc macro panics r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
-rw-r--r--crates/proc_macro_srv/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/proc_macro_srv/src/lib.rs b/crates/proc_macro_srv/src/lib.rs
index 6e890f8e2..9cca96994 100644
--- a/crates/proc_macro_srv/src/lib.rs
+++ b/crates/proc_macro_srv/src/lib.rs
@@ -40,7 +40,8 @@ impl ProcMacroSrv {
40 match expander.expand(&task.macro_name, &task.macro_body, task.attributes.as_ref()) { 40 match expander.expand(&task.macro_name, &task.macro_body, task.attributes.as_ref()) {
41 Ok(expansion) => Ok(ExpansionResult { expansion }), 41 Ok(expansion) => Ok(ExpansionResult { expansion }),
42 Err(msg) => { 42 Err(msg) => {
43 Err(format!("Cannot perform expansion for {}: error {:?}", &task.macro_name, msg)) 43 let msg = msg.as_str().unwrap_or("<unknown error>");
44 Err(format!("proc-macro panicked: {}", msg))
44 } 45 }
45 } 46 }
46 } 47 }