Skip to content

Commit 861d007

Browse files
Never build rustdoc in stage 0
When a request for rustdoc is passed for stage 0, x.py build --stage 0 src/tools/rustdoc or ensure(tool::Rustdoc { .. }) with top_stage = 0, we return the rustdoc for that compiler (i.e., the beta rustdoc).
1 parent 57d7cfc commit 861d007

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/tool.rs

+6
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ impl Step for Rustdoc {
418418

419419
fn run(self, builder: &Builder) -> PathBuf {
420420
let target_compiler = builder.compiler(builder.top_stage, self.host);
421+
if target_compiler.stage == 0 {
422+
if !target_compiler.is_snapshot(builder) {
423+
panic!("rustdoc in stage 0 must be snapshot rustdoc");
424+
}
425+
return builder.initial_rustc.with_file_name(exe("rustdoc", &target_compiler.host));
426+
}
421427
let target = target_compiler.host;
422428
let build_compiler = if target_compiler.stage == 0 {
423429
builder.compiler(0, builder.config.build)

0 commit comments

Comments
 (0)