diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-08-04 10:59:28 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-08-04 12:15:52 +0300 |
| commit | 2ac09692e7a79fa49031994351c36d70aa0e752e (patch) | |
| tree | eee7d2ae815d0da3f1b3c48e7a70e19c444d6af3 | |
| parent | 53676730146e38e4697b6204c2ee61a9fd6b7e51 (diff) | |
| download | rust-2ac09692e7a79fa49031994351c36d70aa0e752e.tar.gz rust-2ac09692e7a79fa49031994351c36d70aa0e752e.zip | |
handle crates when they are not specified for std docs
This fixes a regression from https://github.com/rust-lang/rust/pull/128182. Signed-off-by: onur-ozkan <work@onurozkan.dev>
| -rw-r--r-- | src/bootstrap/src/core/build_steps/doc.rs | 14 |
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); |
