@@ -27,15 +27,13 @@ use rustc_span::symbol::{sym, Symbol};
27
27
use smallvec:: SmallVec ;
28
28
use std:: env;
29
29
use std:: env:: consts:: { DLL_PREFIX , DLL_SUFFIX } ;
30
- use std:: io;
31
30
use std:: lazy:: SyncOnceCell ;
32
31
use std:: mem;
33
32
use std:: ops:: DerefMut ;
34
33
#[ cfg( not( parallel_compiler) ) ]
35
34
use std:: panic;
36
35
use std:: path:: { Path , PathBuf } ;
37
36
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
38
- use std:: sync:: { Arc , Mutex } ;
39
37
use std:: thread;
40
38
use tracing:: info;
41
39
@@ -131,7 +129,6 @@ fn scoped_thread<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: F) -
131
129
pub fn run_in_thread_pool_with_globals < F : FnOnce ( ) -> R + Send , R : Send > (
132
130
edition : Edition ,
133
131
_threads : usize ,
134
- stderr : & Option < Arc < Mutex < Vec < u8 > > > > ,
135
132
f : F ,
136
133
) -> R {
137
134
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>(
140
137
cfg = cfg. stack_size ( size) ;
141
138
}
142
139
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) ;
149
141
150
142
scoped_thread ( cfg, main_handler)
151
143
}
@@ -177,7 +169,6 @@ unsafe fn handle_deadlock() {
177
169
pub fn run_in_thread_pool_with_globals < F : FnOnce ( ) -> R + Send , R : Send > (
178
170
edition : Edition ,
179
171
threads : usize ,
180
- stderr : & Option < Arc < Mutex < Vec < u8 > > > > ,
181
172
f : F ,
182
173
) -> R {
183
174
let mut config = rayon:: ThreadPoolBuilder :: new ( )
@@ -199,10 +190,7 @@ pub fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
199
190
// the thread local rustc uses. `session_globals` is captured and set
200
191
// on the new threads.
201
192
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 ( ) )
206
194
} ;
207
195
208
196
config. build_scoped ( main_handler, with_pool) . unwrap ( )
@@ -339,6 +327,7 @@ fn sysroot_candidates() -> Vec<PathBuf> {
339
327
#[ cfg( windows) ]
340
328
fn current_dll_path ( ) -> Option < PathBuf > {
341
329
use std:: ffi:: OsString ;
330
+ use std:: io;
342
331
use std:: os:: windows:: prelude:: * ;
343
332
use std:: ptr;
344
333
0 commit comments