@@ -117,6 +117,7 @@ fn run_in_thread_with_globals<F: FnOnce(CurrentGcx) -> R + Send, R: Send>(
117117 thread_stack_size :  usize , 
118118 edition :  Edition , 
119119 sm_inputs :  SourceMapInputs , 
120+  extra_symbols :  & [ & ' static  str ] , 
120121 f :  F , 
121122)  -> R  { 
122123 // The "thread pool" is a single spawned thread in the non-parallel 
@@ -134,9 +135,12 @@ fn run_in_thread_with_globals<F: FnOnce(CurrentGcx) -> R + Send, R: Send>(
134135 // name contains null bytes. 
135136 let  r = builder
136137 . spawn_scoped ( s,  move  || { 
137-  rustc_span:: create_session_globals_then ( edition,  Some ( sm_inputs) ,  || { 
138-  f ( CurrentGcx :: new ( ) ) 
139-  } ) 
138+  rustc_span:: create_session_globals_then ( 
139+  edition, 
140+  extra_symbols, 
141+  Some ( sm_inputs) , 
142+  || f ( CurrentGcx :: new ( ) ) , 
143+  ) 
140144 } ) 
141145 . unwrap ( ) 
142146 . join ( ) ; 
@@ -152,6 +156,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,
152156 thread_builder_diag :  & EarlyDiagCtxt , 
153157 edition :  Edition , 
154158 threads :  usize , 
159+  extra_symbols :  & [ & ' static  str ] , 
155160 sm_inputs :  SourceMapInputs , 
156161 f :  F , 
157162)  -> R  { 
@@ -168,12 +173,18 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,
168173 let  registry = sync:: Registry :: new ( std:: num:: NonZero :: new ( threads) . unwrap ( ) ) ; 
169174
170175 if  !sync:: is_dyn_thread_safe ( )  { 
171-  return  run_in_thread_with_globals ( thread_stack_size,  edition,  sm_inputs,  |current_gcx| { 
172-  // Register the thread for use with the `WorkerLocal` type. 
173-  registry. register ( ) ; 
174- 
175-  f ( current_gcx) 
176-  } ) ; 
176+  return  run_in_thread_with_globals ( 
177+  thread_stack_size, 
178+  edition, 
179+  sm_inputs, 
180+  extra_symbols, 
181+  |current_gcx| { 
182+  // Register the thread for use with the `WorkerLocal` type. 
183+  registry. register ( ) ; 
184+ 
185+  f ( current_gcx) 
186+  } , 
187+  ) ; 
177188 } 
178189
179190 let  current_gcx = FromDyn :: from ( CurrentGcx :: new ( ) ) ; 
@@ -230,7 +241,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,
230241 // pool. Upon creation, each worker thread created gets a copy of the 
231242 // session globals in TLS. This is possible because `SessionGlobals` impls 
232243 // `Send` in the parallel compiler. 
233-  rustc_span:: create_session_globals_then ( edition,  Some ( sm_inputs) ,  || { 
244+  rustc_span:: create_session_globals_then ( edition,  extra_symbols ,   Some ( sm_inputs) ,  || { 
234245 rustc_span:: with_session_globals ( |session_globals| { 
235246 let  session_globals = FromDyn :: from ( session_globals) ; 
236247 builder
0 commit comments