Re-enable relative paths for std links in rustc-docs#153162
Open
arferreira wants to merge 1 commit intorust-lang:mainfrom
Open
Re-enable relative paths for std links in rustc-docs#153162arferreira wants to merge 1 commit intorust-lang:mainfrom
arferreira wants to merge 1 commit intorust-lang:mainfrom
Conversation
GuillaumeGomez
approved these changes
Feb 27, 2026
Member
|
Looks good to me, thanks! For now, blocked on #153160. |
eggyal
reviewed
Mar 2, 2026
Comment on lines
+956
to
+959
| // Link std crates to local docs. Installed layout: | ||
| // html/ <- std docs (core/, std/, alloc/, ...) | ||
| // html/rustc-docs/ <- compiler docs | ||
| // `../../` from rustc-docs/*/index.html reaches html/. |
Contributor
There was a problem hiding this comment.
This might be the installed layout, but if someone simply does ./x doc and browses the documentation in their build/doc directory, I guess these relative links won't work? Is that a use case we care about? Perhaps we could change the layout in the build directory to be consistent with the "installed" layout?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #151496.
PR #152243 added
--extern-html-root-url core=../so rustc-docs would link to local std docs for offline usage. It caused #152917 because../was the wrong depth — at depth 2+ pages the links resolved inside the compiler docs tree instead of reaching the std docs. #152976 reverted it.From
rustc-docs/rustc_middle/index.html,../../core/reacheshtml/core/. The published layout on doc.rust-lang.org works the same way (nightly/nightly-rustc/→../../→nightly/).Rustdoc's
remote_url_prefix(#152977) handles deeper module pages by adding extra../segments automatically. Source pages get correct depth viaremote_item_depth(#153160).r? @GuillaumeGomez