Skip to content

Commit 57ee7a6

Browse files
Correctly handle "--open" option when building compiler docs
1 parent bc49c3b commit 57ee7a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bootstrap/doc.rs

+9
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,24 @@ impl Step for Rustc {
648648
}
649649
}
650650

651+
let mut to_open = None;
651652
for krate in &compiler_crates {
652653
// Create all crate output directories first to make sure rustdoc uses
653654
// relative links.
654655
// FIXME: Cargo should probably do this itself.
655656
t!(fs::create_dir_all(out_dir.join(krate)));
656657
cargo.arg("-p").arg(krate);
658+
if to_open.is_none() {
659+
to_open = Some(krate);
660+
}
657661
}
658662

659663
builder.run(&mut cargo.into());
664+
// Let's open the first crate documentation page:
665+
if let Some(krate) = to_open {
666+
let index = out.join(krate).join("index.html");
667+
open(builder, &index);
668+
}
660669
}
661670
}
662671

0 commit comments

Comments
 (0)