We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 661e8be + 48438ce commit 4ce257fCopy full SHA for 4ce257f
src/librustdoc/doctest.rs
@@ -399,7 +399,7 @@ fn run_test(
399
eprint!("{}", self.0);
400
}
401
402
- let mut out_lines = str::from_utf8(&output.stderr)
+ let mut out = str::from_utf8(&output.stderr)
403
.unwrap()
404
.lines()
405
.filter(|l| {
@@ -410,15 +410,15 @@ fn run_test(
410
true
411
412
})
413
- .collect::<Vec<_>>();
+ .intersperse_with(|| "\n")
414
+ .collect::<String>();
415
416
// Add a \n to the end to properly terminate the last line,
417
// but only if there was output to be printed
- if !out_lines.is_empty() {
418
- out_lines.push("");
+ if !out.is_empty() {
419
+ out.push('\n');
420
421
- let out = out_lines.join("\n");
422
let _bomb = Bomb(&out);
423
match (output.status.success(), lang_string.compile_fail) {
424
(true, true) => {
0 commit comments