mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Better error when a proc macro panics
This commit is contained in:
parent
b3ceee2a27
commit
6c4d5164d9
@ -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("<unknown error>");
|
||||
Err(format!("proc-macro panicked: {}", msg))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user