about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-09-05 17:24:09 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-09-17 13:38:56 +0200
commit57ee7a63ebc28e9ed645702fa152b8f35a0cd538 (patch)
treebe7d1f97a07ac6d8778696a3711aa4f07a5974e1 /src/bootstrap
parentbc49c3b6516779acb5b0bf2eae6d1404ead216eb (diff)
downloadrust-57ee7a63ebc28e9ed645702fa152b8f35a0cd538.tar.gz
rust-57ee7a63ebc28e9ed645702fa152b8f35a0cd538.zip
Correctly handle "--open" option when building compiler docs
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/doc.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index 5a1593d7405..a1a954fdfce 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -648,15 +648,24 @@ impl Step for Rustc {
             }
         }
 
+        let mut to_open = None;
         for krate in &compiler_crates {
             // Create all crate output directories first to make sure rustdoc uses
             // relative links.
             // FIXME: Cargo should probably do this itself.
             t!(fs::create_dir_all(out_dir.join(krate)));
             cargo.arg("-p").arg(krate);
+            if to_open.is_none() {
+                to_open = Some(krate);
+            }
         }
 
         builder.run(&mut cargo.into());
+        // Let's open the first crate documentation page:
+        if let Some(krate) = to_open {
+            let index = out.join(krate).join("index.html");
+            open(builder, &index);
+        }
     }
 }