1
Fork 0

Remove unnecessary with_globals calls

This commit is contained in:
John Kåre Alsaker 2019-03-28 18:58:43 +01:00
parent 237bf3244f
commit e9a8befd2d
2 changed files with 8 additions and 10 deletions

View file

@ -136,14 +136,12 @@ where
F: FnOnce(&Compiler) -> R + Send, F: FnOnce(&Compiler) -> R + Send,
R: Send, R: Send,
{ {
syntax::with_globals(move || { let stderr = config.stderr.take();
let stderr = config.stderr.take(); util::spawn_thread_pool(
util::spawn_thread_pool( config.opts.debugging_opts.threads,
config.opts.debugging_opts.threads, &stderr,
&stderr, || run_compiler_in_existing_thread_pool(config, f),
|| run_compiler_in_existing_thread_pool(config, f), )
)
})
} }
pub fn default_thread_pool<F, R>(f: F) -> R pub fn default_thread_pool<F, R>(f: F) -> R

View file

@ -443,7 +443,7 @@ where R: 'static + Send,
let (tx, rx) = channel(); let (tx, rx) = channel();
let result = rustc_driver::report_ices_to_stderr_if_any(move || syntax::with_globals(move || { let result = rustc_driver::report_ices_to_stderr_if_any(move || {
let crate_name = options.crate_name.clone(); let crate_name = options.crate_name.clone();
let crate_version = options.crate_version.clone(); let crate_version = options.crate_version.clone();
let (mut krate, renderinfo, renderopts, passes) = core::run_core(options); let (mut krate, renderinfo, renderopts, passes) = core::run_core(options);
@ -462,7 +462,7 @@ where R: 'static + Send,
renderopts, renderopts,
passes: passes passes: passes
})).unwrap(); })).unwrap();
})); });
match result { match result {
Ok(()) => rx.recv().unwrap(), Ok(()) => rx.recv().unwrap(),