Skip to content

Commit 706d600

Browse files
committed
bootstrap: ensure(doc::Std) no longer opens a browser
In general, the rationale for `--open` is to only open HTML files if they were "explicitly" invoked from the CLI (e.g. `x doc --open library/core`). The existing logic did not do that. Instead it opened the docs unconditionally when a subset of the crates was requested. This is unfortunate for other Steps in bootstrap, which may wish to `ensure()` the standard library docs without opening them. Change `Std` to check if it was explicitly invoked, rather than assuming it's the case.
1 parent f5e2df7 commit 706d600

File tree

1 file changed

+2
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+2
-2
lines changed

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,12 +709,12 @@ impl Step for Std {
709709
if builder.paths.iter().any(|path| path.ends_with("library")) {
710710
// For `x.py doc library --open`, open `std` by default.
711711
let index = out.join("std").join("index.html");
712-
builder.open_in_browser(index);
712+
builder.maybe_open_in_browser::<Self>(index);
713713
} else {
714714
for requested_crate in crates {
715715
if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) {
716716
let index = out.join(requested_crate).join("index.html");
717-
builder.open_in_browser(index);
717+
builder.maybe_open_in_browser::<Self>(index);
718718
break;
719719
}
720720
}

0 commit comments

Comments
 (0)