Skip to content

Commit 7f514e2

Browse files
Rollup merge of rust-lang#152243 - arferreira:fix-rustc-docs-local, r=GuillaumeGomez
Use relative paths for std links in rustc-docs Fixes rust-lang#151496 This adds `--extern-html-root-url` for each `STD_PUBLIC_CRATES` entry pointing to `../`, so that `rustc-docs` links to the locally installed `rust-docs` via relative paths. r? @GuillaumeGomez @rami3l
2 parents 98ae26c + dcfc23a commit 7f514e2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • src/bootstrap/src/core/build_steps

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,13 @@ impl Step for Rustc {
953953
cargo.rustdocflag("--extern-html-root-url");
954954
cargo.rustdocflag("ena=https://docs.rs/ena/latest/");
955955

956+
// Point std library crate links to local docs for offline usage.
957+
for krate in STD_PUBLIC_CRATES {
958+
cargo.rustdocflag("--extern-html-root-url");
959+
cargo.rustdocflag(&format!("{krate}=../"));
960+
}
961+
cargo.rustdocflag("--extern-html-root-takes-precedence");
962+
956963
let mut to_open = None;
957964

958965
let out_dir = builder.stage_out(build_compiler, Mode::Rustc).join(target).join("doc");

0 commit comments

Comments
 (0)