Skip to content

Commit 5545192

Browse files
committed
enable cargo miri test doctests
Signed-off-by: onur-ozkan <[email protected]>
1 parent 42198bf commit 5545192

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/bootstrap/src/core/build_steps/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,10 @@ impl Step for Miri {
680680
.arg("--manifest-path")
681681
.arg(builder.src.join("src/tools/miri/test-cargo-miri/Cargo.toml"));
682682
cargo.arg("--target").arg(target.rustc_target_arg());
683-
cargo.arg("--tests"); // don't run doctests, they are too confused by the staging
684-
cargo.arg("--").args(builder.config.test_args());
685683

684+
cargo.arg("--").args(builder.config.test_args());
686685
// Tell `cargo miri` where to find things.
686+
cargo.env("RUSTDOC_REAL", builder.rustdoc(compiler_std));
687687
cargo.env("MIRI_SYSROOT", &miri_sysroot);
688688
cargo.env("MIRI_HOST_SYSROOT", sysroot);
689689
cargo.env("MIRI", &miri);

src/tools/miri/cargo-miri/src/phases.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,10 @@ pub fn phase_rustdoc(mut args: impl Iterator<Item = String>) {
582582
.map_or(0, |verbose| verbose.parse().expect("verbosity flag must be an integer"));
583583

584584
// phase_cargo_miri sets the RUSTDOC env var to ourselves, so we can't use that here;
585-
// just default to a straight-forward invocation for now:
586-
let mut cmd = Command::new("rustdoc");
585+
// If available, use the one provided by bootstrap; otherwise, simply default to a straightforward
586+
// invocation for now:
587+
let rustdoc = env::var("RUSTDOC_REAL").unwrap_or("rustdoc".to_string());
588+
let mut cmd = Command::new(rustdoc);
587589

588590
let extern_flag = "--extern";
589591
let runtool_flag = "--runtool";

0 commit comments

Comments
 (0)