X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Fdoc.rs;h=9bad9046ecc2c4fed4a122d5d2a60ccf2adda4c1;hb=6d7e2135f15eeb9a586ef97bb6a7744e5a936777;hp=5838049aa5c79d96d240e0a11b2e3dbc5e74e02d;hpb=8b3d0c4cf9f8a8b77805ee5b9bcd18d02c600f22;p=rust.git diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 5838049aa5c..9bad9046ecc 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -12,6 +12,7 @@ use std::io; use std::path::{Path, PathBuf}; +use crate::builder::crate_description; use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step}; use crate::cache::{Interned, INTERNER}; use crate::compile; @@ -506,7 +507,11 @@ fn run(self, builder: &Builder<'_>) { // Look for library/std, library/core etc in the `x.py doc` arguments and // open the corresponding rendered docs. for requested_crate in requested_crates { - if STD_PUBLIC_CRATES.iter().any(|k| *k == requested_crate.as_str()) { + if requested_crate == "library" { + // For `x.py doc library --open`, open `std` by default. + let index = out.join("std").join("index.html"); + builder.open_in_browser(index); + } else if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) { let index = out.join(requested_crate).join("index.html"); builder.open_in_browser(index); } @@ -554,7 +559,8 @@ fn doc_std( requested_crates: &[String], ) { builder.info(&format!( - "Documenting stage{} std ({}) in {} format", + "Documenting{} stage{} library ({}) in {} format", + crate_description(requested_crates), stage, target, format.as_str()