Don't discard attributed items when a proc-macro unexpectedly fails to expand

This commit is contained in:
Lukas Wirth 2021-10-27 14:35:58 +02:00
parent 54e6583f53
commit 98cff6572d
2 changed files with 23 additions and 13 deletions

View file

@ -167,7 +167,7 @@ impl ProcMacro {
let request = msg::Request::ExpandMacro(task);
let response = self.process.lock().unwrap_or_else(|e| e.into_inner()).send_task(request)?;
match response {
msg::Response::ExpandMacro(it) => Ok(it.map(|it| it.to_subtree())),
msg::Response::ExpandMacro(it) => Ok(it.map(FlatTree::to_subtree)),
msg::Response::ListMacros { .. } => {
Err(ServerError { message: "unexpected response".to_string(), io: None })
}