]> git.lizzy.rs Git - rust.git/commitdiff
Never build rustdoc in stage 0
authorMark Rousskov <mark.simulacrum@gmail.com>
Wed, 6 Feb 2019 10:37:43 +0000 (11:37 +0100)
committerMark Rousskov <mark.simulacrum@gmail.com>
Mon, 11 Feb 2019 13:23:47 +0000 (06:23 -0700)
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).

src/bootstrap/tool.rs

index cd3afc59e560c1390c918b6d4939af7e27e5cb29..45bf26f687a48d5377a9c7bc3555a0d73a74372b 100644 (file)
@@ -418,6 +418,12 @@ fn make_run(run: RunConfig) {
 
     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)