@@ -27,15 +27,13 @@ use rustc_span::symbol::{sym, Symbol};
2727use smallvec:: SmallVec ;
2828use std:: env;
2929use std:: env:: consts:: { DLL_PREFIX , DLL_SUFFIX } ;
30- use std:: io;
3130use std:: lazy:: SyncOnceCell ;
3231use std:: mem;
3332use std:: ops:: DerefMut ;
3433#[ cfg( not( parallel_compiler) ) ]
3534use std:: panic;
3635use std:: path:: { Path , PathBuf } ;
3736use std:: sync:: atomic:: { AtomicBool , Ordering } ;
38- use std:: sync:: { Arc , Mutex } ;
3937use std:: thread;
4038use tracing:: info;
4139
@@ -131,7 +129,6 @@ fn scoped_thread<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: F) -
131129pub fn run_in_thread_pool_with_globals < F : FnOnce ( ) -> R + Send , R : Send > (
132130 edition : Edition ,
133131 _threads : usize ,
134- stderr : & Option < Arc < Mutex < Vec < u8 > > > > ,
135132 f : F ,
136133) -> R {
137134 let mut cfg = thread:: Builder :: new ( ) . name ( "rustc" . to_string ( ) ) ;
@@ -140,12 +137,7 @@ pub fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
140137 cfg = cfg. stack_size ( size) ;
141138 }
142139
143- let main_handler = move || {
144- rustc_span:: create_session_globals_then ( edition, || {
145- io:: set_output_capture ( stderr. clone ( ) ) ;
146- f ( )
147- } )
148- } ;
140+ let main_handler = move || rustc_span:: create_session_globals_then ( edition, f) ;
149141
150142 scoped_thread ( cfg, main_handler)
151143}
@@ -177,7 +169,6 @@ unsafe fn handle_deadlock() {
177169pub fn run_in_thread_pool_with_globals < F : FnOnce ( ) -> R + Send , R : Send > (
178170 edition : Edition ,
179171 threads : usize ,
180- stderr : & Option < Arc < Mutex < Vec < u8 > > > > ,
181172 f : F ,
182173) -> R {
183174 let mut config = rayon:: ThreadPoolBuilder :: new ( )
@@ -199,10 +190,7 @@ pub fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
199190 // the thread local rustc uses. `session_globals` is captured and set
200191 // on the new threads.
201192 let main_handler = move |thread : rayon:: ThreadBuilder | {
202- rustc_span:: set_session_globals_then ( session_globals, || {
203- io:: set_output_capture ( stderr. clone ( ) ) ;
204- thread. run ( )
205- } )
193+ rustc_span:: set_session_globals_then ( session_globals, || thread. run ( ) )
206194 } ;
207195
208196 config. build_scoped ( main_handler, with_pool) . unwrap ( )
@@ -339,6 +327,7 @@ fn sysroot_candidates() -> Vec<PathBuf> {
339327 #[ cfg( windows) ]
340328 fn current_dll_path ( ) -> Option < PathBuf > {
341329 use std:: ffi:: OsString ;
330+ use std:: io;
342331 use std:: os:: windows:: prelude:: * ;
343332 use std:: ptr;
344333
0 commit comments