Skip to content

Commit e76b412

Browse files
committed
Rollup merge of rust-lang#23846 - rayglover:patch-rustdoc-stderr, r=alexcrichton
Currently if a rustdoc test panics then the fatal error message is not forwarded to the user. This change will have the test runner prefer forwarding anything on the stderr of the test process.
2 parents a4da0d8 + 5dc23be commit e76b412

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/test.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ fn runtest(test: &str, cratename: &str, libs: SearchPaths,
243243
if should_panic && out.status.success() {
244244
panic!("test executable succeeded when it should have failed");
245245
} else if !should_panic && !out.status.success() {
246-
panic!("test executable failed:\n{:?}",
247-
str::from_utf8(&out.stdout));
246+
panic!("test executable failed:\n{}\n{}",
247+
str::from_utf8(&out.stdout).unwrap_or(""),
248+
str::from_utf8(&out.stderr).unwrap_or(""));
248249
}
249250
}
250251
}

0 commit comments

Comments
 (0)