Skip to content

Commit 26cc0be

Browse files
committed
Fix x test src/librustdoc --no-doc
Previously, it would erroneously try to run the doc-tests anyway and give an error: ``` Doc-tests rustdoc thread 'main' panicked at 'RUSTDOC_LIBDIR was not set', src/bootstrap/bin/rustdoc.rs:15:48 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: test failed, to rerun pass '--doc' ```
1 parent 1d24c2e commit 26cc0be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bootstrap/test.rs

+9
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,15 @@ impl Step for CrateRustdoc {
21182118
if test_kind.subcommand() == "test" && !builder.fail_fast {
21192119
cargo.arg("--no-fail-fast");
21202120
}
2121+
match builder.doc_tests {
2122+
DocTests::Only => {
2123+
cargo.arg("--doc");
2124+
}
2125+
DocTests::No => {
2126+
cargo.args(&["--lib", "--bins", "--examples", "--tests", "--benches"]);
2127+
}
2128+
DocTests::Yes => {}
2129+
}
21212130

21222131
cargo.arg("-p").arg("rustdoc:0.0.0");
21232132

0 commit comments

Comments
 (0)