From 0b37900b40e8db004b2a13ff4c70fc363eba610b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Mon, 20 May 2019 03:39:48 +0200 Subject: [PATCH] Specify the edition for the rustdoc thread-pool --- src/librustc_interface/interface.rs | 4 ++-- src/librustdoc/lib.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/librustc_interface/interface.rs b/src/librustc_interface/interface.rs index d598a48649ee..674b2b60e44a 100644 --- a/src/librustc_interface/interface.rs +++ b/src/librustc_interface/interface.rs @@ -143,10 +143,10 @@ where ) } -pub fn default_thread_pool(f: F) -> R +pub fn default_thread_pool(edition: edition::Edition, f: F) -> R where F: FnOnce() -> R + Send, R: Send, { - util::spawn_thread_pool(edition::DEFAULT_EDITION, None, &None, f) + util::spawn_thread_pool(edition, None, &None, f) } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index f5061b671828..ffe277ae50bd 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -94,9 +94,7 @@ pub fn main() { rustc_driver::set_sigpipe_handler(); env_logger::init(); let res = std::thread::Builder::new().stack_size(thread_stack_size).spawn(move || { - rustc_interface::interface::default_thread_pool(move || { - get_args().map(|args| main_args(&args)).unwrap_or(1) - }) + get_args().map(|args| main_args(&args)).unwrap_or(1) }).unwrap().join().unwrap_or(rustc_driver::EXIT_FAILURE); process::exit(res); } @@ -382,7 +380,12 @@ fn main_args(args: &[String]) -> i32 { Ok(opts) => opts, Err(code) => return code, }; + rustc_interface::interface::default_thread_pool(options.edition, move || { + main_options(options) + }) +} +fn main_options(options: config::Options) -> i32 { let diag = core::new_handler(options.error_format, None, options.debugging_options.treat_err_as_bug,