Skip to content

Commit

Permalink
Remove unnecessary with_globals calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 28, 2019
1 parent 237bf32 commit e9a8bef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/librustc_interface/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ where
F: FnOnce(&Compiler) -> R + Send,
R: Send,
{
syntax::with_globals(move || {
let stderr = config.stderr.take();
util::spawn_thread_pool(
config.opts.debugging_opts.threads,
&stderr,
|| run_compiler_in_existing_thread_pool(config, f),
)
})
let stderr = config.stderr.take();
util::spawn_thread_pool(
config.opts.debugging_opts.threads,
&stderr,
|| run_compiler_in_existing_thread_pool(config, f),
)
}

pub fn default_thread_pool<F, R>(f: F) -> R
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ where R: 'static + Send,

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_version = options.crate_version.clone();
let (mut krate, renderinfo, renderopts, passes) = core::run_core(options);
Expand All @@ -462,7 +462,7 @@ where R: 'static + Send,
renderopts,
passes: passes
})).unwrap();
}));
});

match result {
Ok(()) => rx.recv().unwrap(),
Expand Down

0 comments on commit e9a8bef

Please sign in to comment.