Skip to content

Commit af4e3e0

Browse files
committed
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.
1 parent 5301407 commit af4e3e0

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/librustc_interface/interface.rs

-11
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use rustc_session::early_error;
1717
use rustc_session::lint;
1818
use rustc_session::parse::{CrateConfig, ParseSess};
1919
use rustc_session::{DiagnosticOutput, Session};
20-
use rustc_span::edition;
2120
use rustc_span::source_map::{FileLoader, FileName};
2221
use std::path::PathBuf;
2322
use std::result;
@@ -208,13 +207,3 @@ pub fn run_compiler<R: Send>(mut config: Config, f: impl FnOnce(&Compiler) -> R
208207
|| create_compiler_and_run(config, f),
209208
)
210209
}
211-
212-
pub fn setup_callbacks_and_run_in_default_thread_pool_with_globals<R: Send>(
213-
edition: edition::Edition,
214-
f: impl FnOnce() -> R + Send,
215-
) -> R {
216-
// the 1 here is duplicating code in config.opts.debugging_opts.threads
217-
// which also defaults to 1; it ultimately doesn't matter as the default
218-
// isn't threaded, and just ignores this parameter
219-
util::setup_callbacks_and_run_in_thread_pool_with_globals(edition, 1, &None, f)
220-
}

src/librustdoc/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,10 @@ fn main_args(args: &[String]) -> MainResult {
431431
Ok(opts) => opts,
432432
Err(code) => return if code == 0 { Ok(()) } else { Err(ErrorReported) },
433433
};
434-
rustc_interface::interface::setup_callbacks_and_run_in_default_thread_pool_with_globals(
434+
rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals(
435435
options.edition,
436+
1, // this runs single-threaded, even in a parallel compiler
437+
&None,
436438
move || main_options(options),
437439
)
438440
}

0 commit comments

Comments
 (0)