about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-02-06 11:37:43 +0100
committerMark Rousskov <mark.simulacrum@gmail.com>2019-02-11 06:23:47 -0700
commit861d007da39418cc145a054cd46c89664ba72e64 (patch)
tree8d22c573cc1b2650d3eab3e90327503dd57ce757
parent57d7cfc3cf50f0c427ad3043ff09eaef20671320 (diff)
downloadrust-861d007da39418cc145a054cd46c89664ba72e64.tar.gz
rust-861d007da39418cc145a054cd46c89664ba72e64.zip
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).
-rw-r--r--src/bootstrap/tool.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index cd3afc59e56..45bf26f687a 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -418,6 +418,12 @@ impl Step for Rustdoc {
 
     fn run(self, builder: &Builder) -> PathBuf {
         let target_compiler = builder.compiler(builder.top_stage, self.host);
+        if target_compiler.stage == 0 {
+            if !target_compiler.is_snapshot(builder) {
+                panic!("rustdoc in stage 0 must be snapshot rustdoc");
+            }
+            return builder.initial_rustc.with_file_name(exe("rustdoc", &target_compiler.host));
+        }
         let target = target_compiler.host;
         let build_compiler = if target_compiler.stage == 0 {
             builder.compiler(0, builder.config.build)