Skip to content

Commit 722e63a

Browse files
Make libtest::ERROR_EXIT_CODE const public to not redefine it in rustdoc
1 parent e05ab47 commit 722e63a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

library/test/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ use options::RunStrategy;
8989
use test_result::*;
9090
use time::TestExecTime;
9191

92-
// Process exit code to be used to indicate test failures.
93-
const ERROR_EXIT_CODE: i32 = 101;
92+
/// Process exit code to be used to indicate test failures.
93+
pub const ERROR_EXIT_CODE: i32 = 101;
9494

9595
const SECONDARY_TEST_INVOKER_VAR: &str = "__RUST_TEST_INVOKE";
9696
const SECONDARY_TEST_BENCH_BENCHMARKS_VAR: &str = "__RUST_TEST_BENCH_BENCHMARKS";

src/librustdoc/doctest.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,7 @@ pub(crate) fn run_tests(
359359
if nb_errors != 0 {
360360
// We ensure temp dir destructor is called.
361361
std::mem::drop(temp_dir);
362-
// libtest::ERROR_EXIT_CODE is not public but it's the same value.
363-
std::process::exit(101);
362+
std::process::exit(test::ERROR_EXIT_CODE);
364363
}
365364
}
366365

0 commit comments

Comments
 (0)