Skip to content

Commit 3e7ed28

Browse files
committed
Auto merge of #52181 - QuietMisdreavus:panicked-tester, r=GuillaumeGomez
rustdoc: set panic output before starting compiler thread pool When the compiler was updated to run on a thread pool, rustdoc's processing of compiler/doctest stderr/stdout was moved into each compiler thread. However, this caused output of the test to be lost if the test failed at *runtime* instead of compile time. This change sets up the `set_panic` call and output bomb before starting the compiler thread pool, so that the `Drop` call that writes back to the test's stdout happens after the test runs, not just after it compiles. Fixes rust-lang/rust#51162
2 parents e7302d7 + 4ae0648 commit 3e7ed28

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/header.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,18 +392,20 @@ impl TestProps {
392392

393393
if let Some(code) = config.parse_failure_status(ln) {
394394
self.failure_status = code;
395-
} else {
396-
self.failure_status = match config.mode {
397-
Mode::RunFail => 101,
398-
_ => 1,
399-
};
400395
}
401396

402397
if !self.run_rustfix {
403398
self.run_rustfix = config.parse_run_rustfix(ln);
404399
}
405400
});
406401

402+
if self.failure_status == -1 {
403+
self.failure_status = match config.mode {
404+
Mode::RunFail => 101,
405+
_ => 1,
406+
};
407+
}
408+
407409
for key in &["RUST_TEST_NOCAPTURE", "RUST_TEST_THREADS"] {
408410
if let Ok(val) = env::var(key) {
409411
if self.exec_env.iter().find(|&&(ref x, _)| x == key).is_none() {

0 commit comments

Comments
 (0)