about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2019-05-20 03:39:48 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2019-05-21 18:17:06 +0200
commit0b37900b40e8db004b2a13ff4c70fc363eba610b (patch)
treea66d8c17b0f0a613afe0c0407d5b5ce44b3180c9
parenta1f2dceaebd21a6f8a5f9341bf41724bb20e2a7d (diff)
Specify the edition for the rustdoc thread-pool
-rw-r--r--src/librustc_interface/interface.rs4
-rw-r--r--src/librustdoc/lib.rs9
2 files changed, 8 insertions, 5 deletions
diff --git a/src/librustc_interface/interface.rs b/src/librustc_interface/interface.rs
index d598a48649e..674b2b60e44 100644
--- a/src/librustc_interface/interface.rs
+++ b/src/librustc_interface/interface.rs
@@ -143,10 +143,10 @@ where
     )
 }
 
-pub fn default_thread_pool<F, R>(f: F) -> R
+pub fn default_thread_pool<F, R>(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 f5061b67182..ffe277ae50b 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,