diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-08-04 09:42:14 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-08-05 10:42:45 +1000 |
| commit | af4e3e08ea3d9739e5af541b737527584cea1d8f (patch) | |
| tree | 7e5bd0355aa4b9e16720d1c82b6859ab8e76e26a | |
| parent | 530140729a458462f5c6e735e771651ce419a0a3 (diff) | |
| download | rust-af4e3e08ea3d9739e5af541b737527584cea1d8f.tar.gz rust-af4e3e08ea3d9739e5af541b737527584cea1d8f.zip | |
Remove `setup_callbacks_and_run_in_default_thread_pool_with_globals()`.
It's a very thin wrapper around `setup_callbacks_and_run_in_thread_pool_with_globals()` and it has a single call site.
| -rw-r--r-- | src/librustc_interface/interface.rs | 11 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 4 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/librustc_interface/interface.rs b/src/librustc_interface/interface.rs index e50622a0053..ad30f5eda4d 100644 --- a/src/librustc_interface/interface.rs +++ b/src/librustc_interface/interface.rs @@ -17,7 +17,6 @@ use rustc_session::early_error; use rustc_session::lint; use rustc_session::parse::{CrateConfig, ParseSess}; use rustc_session::{DiagnosticOutput, Session}; -use rustc_span::edition; use rustc_span::source_map::{FileLoader, FileName}; use std::path::PathBuf; use std::result; @@ -208,13 +207,3 @@ pub fn run_compiler<R: Send>(mut config: Config, f: impl FnOnce(&Compiler) -> R || create_compiler_and_run(config, f), ) } - -pub fn setup_callbacks_and_run_in_default_thread_pool_with_globals<R: Send>( - edition: edition::Edition, - f: impl FnOnce() -> R + Send, -) -> R { - // the 1 here is duplicating code in config.opts.debugging_opts.threads - // which also defaults to 1; it ultimately doesn't matter as the default - // isn't threaded, and just ignores this parameter - util::setup_callbacks_and_run_in_thread_pool_with_globals(edition, 1, &None, f) -} diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index a12ba50d6c3..04c6dd2f206 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -431,8 +431,10 @@ fn main_args(args: &[String]) -> MainResult { Ok(opts) => opts, Err(code) => return if code == 0 { Ok(()) } else { Err(ErrorReported) }, }; - rustc_interface::interface::setup_callbacks_and_run_in_default_thread_pool_with_globals( + rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals( options.edition, + 1, // this runs single-threaded, even in a parallel compiler + &None, move || main_options(options), ) } |
