Skip to content

Commit 7411a9e

Browse files
committedJun 4, 2021
rustdoc: link to stable/beta docs consistently in documentation
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
1 parent c4c2ab5 commit 7411a9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+139
-120
lines changed
 

‎library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#![allow(unused_attributes)]
6060
#![stable(feature = "alloc", since = "1.36.0")]
6161
#![doc(
62-
html_root_url = "https://doc.rust-lang.org/nightly/",
6362
html_playground_url = "https://play.rust-lang.org/",
6463
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
6564
test(no_crate_inject, attr(allow(unused_variables), deny(warnings)))

‎library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#![cfg(not(test))]
5252
#![stable(feature = "core", since = "1.6.0")]
5353
#![doc(
54-
html_root_url = "https://doc.rust-lang.org/nightly/",
5554
html_playground_url = "https://play.rust-lang.org/",
5655
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
5756
test(no_crate_inject, attr(deny(warnings))),

0 commit comments

Comments
 (0)
Please sign in to comment.