about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-05 18:36:02 +0200
committerGitHub <noreply@github.com>2024-08-05 18:36:02 +0200
commit9d924d11c4ba55856899b3659b73c294d1b6af4d (patch)
tree9897dbf6450456cddaaa66925ab462c8109c6f03
parent63482af9821b575b6e5526b9557f493b8d04b3f9 (diff)
parent2ac09692e7a79fa49031994351c36d70aa0e752e (diff)
downloadrust-9d924d11c4ba55856899b3659b73c294d1b6af4d.tar.gz
rust-9d924d11c4ba55856899b3659b73c294d1b6af4d.zip
Rollup merge of #128631 - onur-ozkan:hotfix, r=Mark-Simulacrum
handle crates when they are not specified for std docs

Fixes a regression from https://github.com/rust-lang/rust/pull/128182.

Resolves #128610
-rw-r--r--src/bootstrap/src/core/build_steps/doc.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
index 1541396bfdd..2cd5db706c2 100644
--- a/src/bootstrap/src/core/build_steps/doc.rs
+++ b/src/bootstrap/src/core/build_steps/doc.rs
@@ -599,6 +599,16 @@ impl Step for Std {
     fn run(self, builder: &Builder<'_>) {
         let stage = self.stage;
         let target = self.target;
+        let crates = if self.crates.is_empty() {
+            builder
+                .in_tree_crates("sysroot", Some(target))
+                .iter()
+                .map(|c| c.name.to_string())
+                .collect()
+        } else {
+            self.crates
+        };
+
         let out = match self.format {
             DocumentationFormat::Html => builder.doc_out(target),
             DocumentationFormat::Json => builder.json_doc_out(target),
@@ -627,7 +637,7 @@ impl Step for Std {
             extra_args.push("--disable-minification");
         }
 
-        doc_std(builder, self.format, stage, target, &out, &extra_args, &self.crates);
+        doc_std(builder, self.format, stage, target, &out, &extra_args, &crates);
 
         // Don't open if the format is json
         if let DocumentationFormat::Json = self.format {
@@ -639,7 +649,7 @@ impl Step for Std {
             let index = out.join("std").join("index.html");
             builder.open_in_browser(index);
         } else {
-            for requested_crate in &*self.crates {
+            for requested_crate in crates {
                 if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) {
                     let index = out.join(requested_crate).join("index.html");
                     builder.open_in_browser(index);