Skip to content

Commit 10374d3

Browse files
authoredDec 29, 2022
Rollup merge of #105899 - lukas-code:stage-1-docs, r=jyn514
`./x doc library --open` opens `std` fix #105898
2 parents 81c2b72 + 50a8ca5 commit 10374d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/bootstrap/doc.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ impl Step for Std {
506506
// Look for library/std, library/core etc in the `x.py doc` arguments and
507507
// open the corresponding rendered docs.
508508
for requested_crate in requested_crates {
509-
if STD_PUBLIC_CRATES.iter().any(|k| *k == requested_crate.as_str()) {
509+
if requested_crate == "library" {
510+
// For `x.py doc library --open`, open `std` by default.
511+
let index = out.join("std").join("index.html");
512+
builder.open_in_browser(index);
513+
} else if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) {
510514
let index = out.join(requested_crate).join("index.html");
511515
builder.open_in_browser(index);
512516
}

0 commit comments

Comments
 (0)