Skip to content

Commit eacebb4

Browse files
authored
Rollup merge of #96499 - jyn514:bootstrap-doctests, r=Mark-Simulacrum
Make it possible to write doctests for bootstrap This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2 parents 1785f15 + 2f287d6 commit eacebb4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/bootstrap/test.rs

+11
Original file line numberDiff line numberDiff line change
@@ -2359,6 +2359,7 @@ impl Step for Bootstrap {
23592359
.env("RUSTFLAGS", "-Cdebuginfo=2")
23602360
.env("CARGO_TARGET_DIR", builder.out.join("bootstrap"))
23612361
.env("RUSTC_BOOTSTRAP", "1")
2362+
.env("RUSTDOC", builder.rustdoc(builder.compiler(0, builder.build.build)))
23622363
.env("RUSTC", &builder.initial_rustc);
23632364
if let Some(flags) = option_env!("RUSTFLAGS") {
23642365
// Use the same rustc flags for testing as for "normal" compilation,
@@ -2369,6 +2370,16 @@ impl Step for Bootstrap {
23692370
if !builder.fail_fast {
23702371
cmd.arg("--no-fail-fast");
23712372
}
2373+
match builder.doc_tests {
2374+
DocTests::Only => {
2375+
cmd.arg("--doc");
2376+
}
2377+
DocTests::No => {
2378+
cmd.args(&["--lib", "--bins", "--examples", "--tests", "--benches"]);
2379+
}
2380+
DocTests::Yes => {}
2381+
}
2382+
23722383
cmd.arg("--").args(&builder.config.cmd.test_args());
23732384
// rustbuild tests are racy on directory creation so just run them one at a time.
23742385
// Since there's not many this shouldn't be a problem.

0 commit comments

Comments
 (0)