File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
crates/proc-macro-srv/src Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ pub(crate) struct ProcMacroSrv {
3939 expanders : HashMap < ( PathBuf , SystemTime ) , dylib:: Expander > ,
4040}
4141
42+ const EXPANDER_STACK_SIZE : usize = 8 * 1024 * 1024 ;
43+
4244impl ProcMacroSrv {
4345 pub fn expand ( & mut self , task : ExpandMacro ) -> Result < FlatTree , PanicMessage > {
4446 let expander = self . expander ( task. lib . as_ref ( ) ) . map_err ( |err| {
@@ -66,13 +68,18 @@ impl ProcMacroSrv {
6668 // FIXME: replace this with std's scoped threads once they stabilize
6769 // (then remove dependency on crossbeam)
6870 let result = crossbeam:: scope ( |s| {
69- let res = s
71+ let res = match s
72+ . builder ( )
73+ . stack_size ( EXPANDER_STACK_SIZE )
74+ . name ( task. macro_name . clone ( ) )
7075 . spawn ( |_| {
7176 expander
7277 . expand ( & task. macro_name , & macro_body, attributes. as_ref ( ) )
7378 . map ( |it| FlatTree :: new ( & it) )
74- } )
75- . join ( ) ;
79+ } ) {
80+ Ok ( handle) => handle. join ( ) ,
81+ Err ( e) => std:: panic:: resume_unwind ( Box :: new ( e) ) ,
82+ } ;
7683
7784 match res {
7885 Ok ( res) => res,
You can’t perform that action at this time.
0 commit comments