Skip to content

Use relative paths for std links in rustc-docs#152243

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
arferreira:fix-rustc-docs-local
Feb 7, 2026
Merged

Use relative paths for std links in rustc-docs#152243
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
arferreira:fix-rustc-docs-local

Conversation

@arferreira
Copy link
Contributor

@arferreira arferreira commented Feb 6, 2026

Fixes #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

Signed-off-by: arferreira <arfs.antonio@gmail.com>
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 6, 2026
@GuillaumeGomez
Copy link
Member

Thanks for the work! One thought I had: how do we test that? ^^'

@arferreira
Copy link
Contributor Author

Thanks for the work! One thought I had: how do we test that? ^^'

Yeahh def! I tested manually, just built the compiler docs and comparing the HTML output before and after :)

@GuillaumeGomez
Copy link
Member

I expect as much. :p

That was an open question for other rust contributors: how do we check that automatically in the CI to ensure it doesn't regress? Maybe you have an idea @Kobzol ?

@Kobzol
Copy link
Member

Kobzol commented Feb 6, 2026

What's the exact thing that you want to check? That all links in the docs are relative? Doesn't rustdoc already has some similar tests in one of its test suites?

@GuillaumeGomez
Copy link
Member

Nah, just a few cross-crate ones. And we do, but it's unrelated here: we need this fix because std/core are handled differently and point to each others with https:// and not relative paths. What I want to check is that cross-crate links are using relative paths.

@Kobzol
Copy link
Member

Kobzol commented Feb 6, 2026

I guess it would either have to be some rustdoc test that scans the HTML (using some existing machinery), or it would require some large-ish changes. Because the docs that we dist are in the dist components, and we don't really have a notion of testing these today, outside of one hardcoded sanity checks for the PGO-ed rustc toolchain.

@GuillaumeGomez
Copy link
Member

Nothing we can check then? Oh well, I guess I can live with that.

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

📌 Commit dcfc23a has been approved by GuillaumeGomez

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 6, 2026
…=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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 6, 2026
…=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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 6, 2026
…=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
rust-bors bot pushed a commit that referenced this pull request Feb 6, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #149960 (add `unreachable_cfg_select_predicates` lint)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152186 (Convert to inline diagnostics in `rustc_const_eval`)
 - #152234 (Dont strip const blocks in array lengths)
 - #152243 (Use relative paths for std links in rustc-docs)
rust-bors bot pushed a commit that referenced this pull request Feb 7, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152186 (Convert to inline diagnostics in `rustc_const_eval`)
 - #152234 (Dont strip const blocks in array lengths)
 - #152243 (Use relative paths for std links in rustc-docs)
rust-bors bot pushed a commit that referenced this pull request Feb 7, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152186 (Convert to inline diagnostics in `rustc_const_eval`)
 - #152234 (Dont strip const blocks in array lengths)
 - #152243 (Use relative paths for std links in rustc-docs)
@rust-bors rust-bors bot merged commit 7f514e2 into rust-lang:main Feb 7, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Feb 7, 2026
Rollup merge of #152243 - arferreira:fix-rustc-docs-local, r=GuillaumeGomez

Use relative paths for std links in rustc-docs

Fixes #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
@rustbot rustbot added this to the 1.95.0 milestone Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local rustc-docs could make use of local pages for std types

4 participants