run rustdoc tests in the same sort of thread rustc runs in

This commit is contained in:
Niko Matsakis
2017-01-17 18:15:08 -05:00
parent 8780962828
commit d25f066c07
2 changed files with 49 additions and 30 deletions

View File

@@ -29,7 +29,7 @@ use rustc::session::config::{OutputType, OutputTypes, Externs};
use rustc::session::search_paths::{SearchPaths, PathKind};
use rustc_back::dynamic_lib::DynamicLibrary;
use rustc_back::tempdir::TempDir;
use rustc_driver::{driver, Compilation};
use rustc_driver::{self, driver, Compilation};
use rustc_driver::driver::phase_2_configure_and_expand;
use rustc_metadata::cstore::CStore;
use rustc_resolve::MakeGlobMap;
@@ -428,19 +428,26 @@ impl Collector {
should_panic: testing::ShouldPanic::No,
},
testfn: testing::DynTestFn(box move |()| {
runtest(&test,
&cratename,
cfgs,
libs,
externs,
should_panic,
no_run,
as_test_harness,
compile_fail,
error_codes,
&opts,
maybe_sysroot);
})
match {
rustc_driver::in_rustc_thread(move || {
runtest(&test,
&cratename,
cfgs,
libs,
externs,
should_panic,
no_run,
as_test_harness,
compile_fail,
error_codes,
&opts,
maybe_sysroot)
})
} {
Ok(()) => (),
Err(err) => panic::resume_unwind(err),
}
}),
});
}