mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Use std::panic::resume_unwind
This commit is contained in:
parent
48bcc229bf
commit
39db9cdb7d
@ -64,15 +64,23 @@ impl ProcMacroSrv {
|
||||
let macro_body = task.macro_body.to_subtree();
|
||||
let attributes = task.attributes.map(|it| it.to_subtree());
|
||||
let result = crossbeam::scope(|s| {
|
||||
s.spawn(|_| {
|
||||
let res = s
|
||||
.spawn(|_| {
|
||||
expander
|
||||
.expand(&task.macro_name, ¯o_body, attributes.as_ref())
|
||||
.map(|it| FlatTree::new(&it))
|
||||
})
|
||||
.join()
|
||||
.unwrap()
|
||||
})
|
||||
.unwrap();
|
||||
.join();
|
||||
|
||||
match res {
|
||||
Ok(res) => res,
|
||||
Err(e) => std::panic::resume_unwind(e),
|
||||
}
|
||||
});
|
||||
let result = match result {
|
||||
Ok(result) => result,
|
||||
Err(e) => std::panic::resume_unwind(e),
|
||||
};
|
||||
|
||||
prev_env.rollback();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user