Skip to content

Commit

Permalink
Specify the edition for the rustdoc thread-pool
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed May 21, 2019
1 parent a1f2dce commit 0b37900
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/librustc_interface/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
9 changes: 6 additions & 3 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0b37900

Please sign in to comment.