Skip to content

Commit 9877b26

Browse files
Correctly display merged doctest compilation time
1 parent bbcbc78 commit 9877b26

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustdoc/doctest.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,15 @@ pub(crate) fn run_tests(
404404
std::mem::drop(temp_dir.take());
405405
times.display_times();
406406
});
407+
} else {
408+
// If the first condition branch exited successfully, `test_main_with_exit_callback` will
409+
// not exit the process. So to prevent displaying the times twice, we put it behind an
410+
// `else` condition.
411+
times.display_times();
407412
}
413+
// We ensure temp dir destructor is called.
414+
std::mem::drop(temp_dir);
408415
if nb_errors != 0 {
409-
// We ensure temp dir destructor is called.
410-
std::mem::drop(temp_dir);
411-
times.display_times();
412416
std::process::exit(test::ERROR_EXIT_CODE);
413417
}
414418
}

0 commit comments

Comments
 (0)