about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-11-09 19:00:43 +0100
committerGitHub <noreply@github.com>2021-11-09 19:00:43 +0100
commit2fff2606d5e7a0dba6f272b342ecd0b940e3a604 (patch)
tree766288e29f0ceda25000212721112791f57564db /src/bootstrap
parent730c6bf158e6f93a74f1bf5d424fb168d4da0352 (diff)
parent5bf3a5dfc72e68b4a631301b48b30cf913b8cfee (diff)
downloadrust-2fff2606d5e7a0dba6f272b342ecd0b940e3a604.tar.gz
rust-2fff2606d5e7a0dba6f272b342ecd0b940e3a604.zip
Rollup merge of #90683 - jyn514:compiler-docs, r=Mark-Simulacrum
Make `compiler-docs` only control the default instead of being a hard off-switch

This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.

See https://github.com/rust-lang/rust/pull/90354#issuecomment-955854508.

r? ``@Mark-Simulacrum``
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/dist.rs6
-rw-r--r--src/bootstrap/doc.rs15
2 files changed, 5 insertions, 16 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index d4875cfe1b0..a799732adde 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -96,7 +96,8 @@ impl Step for RustcDocs {
     const DEFAULT: bool = true;
 
     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-        run.path("src/librustc")
+        let builder = run.builder;
+        run.path("rustc-docs").default_condition(builder.config.compiler_docs)
     }
 
     fn make_run(run: RunConfig<'_>) {
@@ -106,9 +107,6 @@ impl Step for RustcDocs {
     /// Builds the `rustc-docs` installer component.
     fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
         let host = self.host;
-        if !builder.config.compiler_docs {
-            return None;
-        }
         builder.default_doc(&[]);
 
         let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple);
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index 2804e7119fb..f0f31c447bd 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -529,7 +529,7 @@ impl Step for Rustc {
 
     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
         let builder = run.builder;
-        run.krate("rustc-main").path("compiler").default_condition(builder.config.docs)
+        run.krate("rustc-main").path("compiler").default_condition(builder.config.compiler_docs)
     }
 
     fn make_run(run: RunConfig<'_>) {
@@ -560,11 +560,6 @@ impl Step for Rustc {
             })
             .collect::<Vec<_>>();
 
-        if !builder.config.compiler_docs && !builder.was_invoked_explicitly::<Self>() {
-            builder.info("\tskipping - compiler/librustdoc docs disabled");
-            return;
-        }
-
         // This is the intended out directory for compiler documentation.
         let out = builder.compiler_doc_out(target);
         t!(fs::create_dir_all(&out));
@@ -674,7 +669,8 @@ macro_rules! tool_doc {
             const ONLY_HOSTS: bool = true;
 
             fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-                run.krate($should_run)
+                let builder = run.builder;
+                run.krate($should_run).default_condition(builder.config.compiler_docs)
             }
 
             fn make_run(run: RunConfig<'_>) {
@@ -705,11 +701,6 @@ macro_rules! tool_doc {
 
                 let compiler = builder.compiler(stage, builder.config.build);
 
-                if !builder.config.compiler_docs && !builder.was_invoked_explicitly::<Self>() {
-                    builder.info("\tskipping - compiler/tool docs disabled");
-                    return;
-                }
-
                 // Build rustc docs so that we generate relative links.
                 builder.ensure(Rustc { stage, target });