Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,10 @@ impl Builder<'_> {
}

let rustdoc_path = match cmd_kind {
Kind::Doc | Kind::Test | Kind::MiriTest => self.rustdoc_for_compiler(compiler),
Kind::Doc => self.rustdoc_for_compiler(compiler),
Kind::Test | Kind::MiriTest if self.test_target.runs_doctests() => {
self.rustdoc_for_compiler(compiler)
}
_ => PathBuf::from("/path/to/nowhere/rustdoc/not/required"),
};

Expand Down
13 changes: 13 additions & 0 deletions src/bootstrap/src/core/builder/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,19 @@ mod snapshot {
}
}

#[test]
fn test_library_tests_only_does_not_build_rustdoc() {
let ctx = TestCtx::new();
Comment thread
Kobzol marked this conversation as resolved.
let host = TargetSelection::from_user(&host_target());
insta::assert_snapshot!(
ctx.config("test").args(&["--tests", "library/core"]).render_steps(),
@r"
[build] llvm <host>
[build] rustc 0 <host> -> rustc 1 <host>
[build] rustc 1 <host> -> std 1 <host>
");
}

#[test]
fn test_cargo_stage_1() {
let ctx = TestCtx::new();
Expand Down
Loading