Skip to content

Commit b7ea084

Browse files
committed
pass target_compiler from Rustdoc
Signed-off-by: onur-ozkan <[email protected]>
1 parent ebfb0ce commit b7ea084

File tree

1 file changed

+2
-11
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+2
-11
lines changed

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -650,16 +650,7 @@ impl Step for Rustdoc {
650650
}
651651
}
652652

653-
let build_compiler = if builder.download_rustc() && target_compiler.stage == 1 {
654-
// We already have the stage 1 compiler, we don't need to cut the stage.
655-
builder.compiler(target_compiler.stage, builder.config.build)
656-
} else {
657-
// Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
658-
// we'd have stageN/bin/rustc and stageN/bin/rustdoc be effectively different stage
659-
// compilers, which isn't what we want. Rustdoc should be linked in the same way as the
660-
// rustc compiler it's paired with, so it must be built with the previous stage compiler.
661-
builder.compiler(target_compiler.stage - 1, builder.config.build)
662-
};
653+
let build_compiler = get_tool_rustc_compiler(builder, target_compiler);
663654

664655
// When using `download-rustc` and a stage0 build_compiler, copying rustc doesn't actually
665656
// build stage0 libstd (because the libstd in sysroot has the wrong ABI). Explicitly build
@@ -682,7 +673,7 @@ impl Step for Rustdoc {
682673
// NOTE: Never modify the rustflags here, it breaks the build cache for other tools!
683674
let mut cargo = prepare_tool_cargo(
684675
builder,
685-
build_compiler,
676+
target_compiler,
686677
Mode::ToolRustc,
687678
target,
688679
Kind::Build,

0 commit comments

Comments
 (0)