Skip to content

Commit a6aa509

Browse files
committed
Respect top stage when documenting Cargo
1 parent 9f9473f commit a6aa509

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ macro_rules! tool_doc {
10051005
}
10061006
Mode::ToolTarget => {
10071007
// target tools should be documented with the in-tree compiler
1008-
prepare_doc_compiler(run.builder, run.builder.host_target, 2)
1008+
prepare_doc_compiler(run.builder, run.builder.host_target, run.builder.top_stage)
10091009
}
10101010
_ => {
10111011
panic!("Unexpected tool mode for documenting: {:?}", $mode);

src/bootstrap/src/core/builder/tests.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2463,12 +2463,25 @@ mod snapshot {
24632463
}
24642464

24652465
#[test]
2466-
fn doc_cargo() {
2466+
fn doc_cargo_stage_1() {
24672467
let ctx = TestCtx::new();
24682468
insta::assert_snapshot!(
24692469
ctx.config("doc")
24702470
.path("cargo")
24712471
.render_steps(), @r"
2472+
[build] rustdoc 0 <host>
2473+
[doc] rustc 0 <host> -> Cargo 1 <host>
2474+
");
2475+
}
2476+
2477+
#[test]
2478+
fn doc_cargo_stage_2() {
2479+
let ctx = TestCtx::new();
2480+
insta::assert_snapshot!(
2481+
ctx.config("doc")
2482+
.path("cargo")
2483+
.stage(2)
2484+
.render_steps(), @r"
24722485
[build] llvm <host>
24732486
[build] rustc 0 <host> -> rustc 1 <host>
24742487
[build] rustc 1 <host> -> std 1 <host>

0 commit comments

Comments
 (0)