Skip to content

Commit 81b6b91

Browse files
committed
Auto merge of #27074 - steveklabnik:gh27014, r=alexcrichton
Fixes #27014 r? @alexcrichton I'm not 100% sure there's not a better way to do this, but it works. Also, I wasn't sure how, where, or if to write a test for this.
2 parents e58601a + 82d0442 commit 81b6b91

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustdoc/lib.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn main() {
132132
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
133133
let s = env::args().collect::<Vec<_>>();
134134
main_args(&s)
135-
}).unwrap().join().unwrap();
135+
}).unwrap().join().unwrap_or(101);
136136
process::exit(res as i32);
137137
}
138138

@@ -273,7 +273,6 @@ pub fn main_args(args: &[String]) -> isize {
273273
!matches.opt_present("markdown-no-toc")),
274274
(false, false) => {}
275275
}
276-
277276
let out = match acquire_input(input, externs, &matches) {
278277
Ok(out) => out,
279278
Err(s) => {
@@ -375,12 +374,12 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
375374
info!("starting to run rustc");
376375

377376
let (tx, rx) = channel();
378-
std::thread::spawn(move || {
377+
rustc_driver::monitor(move || {
379378
use rustc::session::config::Input;
380379

381380
tx.send(core::run_core(paths, cfgs, externs, Input::File(cr),
382381
triple)).unwrap();
383-
}).join().map_err(|_| "rustc failed").unwrap();
382+
});
384383
let (mut krate, analysis) = rx.recv().unwrap();
385384
info!("finished with rustc");
386385
let mut analysis = Some(analysis);

0 commit comments

Comments
 (0)