File tree 1 file changed +10
-3
lines changed
crates/proc-macro-srv/src
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 {
39
39
expanders : HashMap < ( PathBuf , SystemTime ) , dylib:: Expander > ,
40
40
}
41
41
42
+ const EXPANDER_STACK_SIZE : usize = 8 * 1024 * 1024 ;
43
+
42
44
impl ProcMacroSrv {
43
45
pub fn expand ( & mut self , task : ExpandMacro ) -> Result < FlatTree , PanicMessage > {
44
46
let expander = self . expander ( task. lib . as_ref ( ) ) . map_err ( |err| {
@@ -66,13 +68,18 @@ impl ProcMacroSrv {
66
68
// FIXME: replace this with std's scoped threads once they stabilize
67
69
// (then remove dependency on crossbeam)
68
70
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 ( ) )
70
75
. spawn ( |_| {
71
76
expander
72
77
. expand ( & task. macro_name , & macro_body, attributes. as_ref ( ) )
73
78
. 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
+ } ;
76
83
77
84
match res {
78
85
Ok ( res) => res,
You can’t perform that action at this time.
0 commit comments