Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-srv/src/lib.rs')
-rw-r--r--crates/proc-macro-srv/src/lib.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/proc-macro-srv/src/lib.rs b/crates/proc-macro-srv/src/lib.rs
index 2ab6eba6f4..98a79f5be3 100644
--- a/crates/proc-macro-srv/src/lib.rs
+++ b/crates/proc-macro-srv/src/lib.rs
@@ -63,9 +63,16 @@ impl ProcMacroSrv {
let macro_body = task.macro_body.to_subtree();
let attributes = task.attributes.map(|it| it.to_subtree());
- let result = expander
- .expand(&task.macro_name, &macro_body, attributes.as_ref())
- .map(|it| FlatTree::new(&it));
+ let result = crossbeam::scope(|s| {
+ s.spawn(|_| {
+ expander
+ .expand(&task.macro_name, &macro_body, attributes.as_ref())
+ .map(|it| FlatTree::new(&it))
+ })
+ .join()
+ .unwrap()
+ })
+ .unwrap();
prev_env.rollback();