1
Fork 0
rust/library/std/src
Yuki Okushi 01b0e6e645
Rollup merge of #84942 - jyn514:channel-replace, r=Manishearth
rustdoc: link to stable/beta docs consistently in documentation

This is an alternative to https://github.com/rust-lang/rust/pull/84941 which fixes the problem consistently by linking to stable/beta for *all* items, not just for primitives.

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

cc Mark-Simulacrum - I know [you were dubious about this in the past](231223124), but I'm not quite sure why? I see this as "just a bugfix", I don't know why rustdoc should unconditionally link to nightly.
cc dtolnay who commented in https://github.com/rust-lang/rust/issues/30693:

>  I would welcome a PR to solve this permanently if anyone has ideas for how. I don't believe we need an RFC.

Fixes https://github.com/rust-lang/rust/issues/30693 (note that issue is marked as feature-accepted, although I don't see where it was discussed).
2021-06-05 06:13:37 +09:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Rollup merge of #84328 - Folyd:stablize_map_into_keys_values, r=m-ou-se 2021-05-06 13:30:54 +02:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f64 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
ffi Add inline attr to private CString::into_inner 2021-05-26 13:12:54 +03:00
fs Fix test metadata_access_times to also check for Unsupported 2021-04-18 09:29:24 +02:00
io remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Remove is_unicast_link_local_strict 2021-05-30 00:32:17 +02:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Not implement os::unix::fs::chroot for vxworks 2021-05-20 01:37:57 +02:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Refactor parse_prefix on Windows 2020-11-07 16:15:48 +01:00
prelude Add tracking issue for edition-specific preludes. 2021-05-25 19:58:39 +02:00
process std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
sync minor rewording after review 2021-05-24 09:24:35 -05:00
sys Support Android ndk versions r23-beta3 and up 2021-06-01 21:37:50 +02:00
sys_common Auto merge of #85060 - ChrisDenton:win-file-exists, r=yaahc 2021-05-21 05:47:24 +00:00
thread std: Don't inline TLS accessor on MinGW 2021-05-20 12:45:05 -07:00
time Duration::zero() -> Duration::ZERO 2020-10-21 20:44:03 -07:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
env.rs change k to key and v to v in std::env mod 2021-05-10 19:31:09 +08:00
error.rs Document "standard" conventions for error messages 2021-04-02 15:11:49 +03:00
f32.rs doc: cube root, not cubic root 2021-02-26 19:03:44 +01:00
f64.rs doc: cube root, not cubic root 2021-02-26 19:03:44 +01:00
fs.rs Move the implementation of Path::exists to sys_common::fs so platforms can specialize it 2021-05-19 23:54:56 +01:00
keyword_docs.rs Fix indentation in move keyword documentation 2021-05-13 23:01:38 +02:00
lazy.rs Use DebugStruct::finish_non_exhaustive() in std. 2021-03-27 13:29:23 +01:00
lib.rs rustdoc: link to stable/beta docs consistently in documentation 2021-06-04 14:18:21 -04:00
macros.rs Change "etc." to "and similar" 2021-05-13 15:02:02 +01:00
num.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
panic.rs Add #[track_caller] to panic_any 2021-05-27 14:19:47 +03:00
panicking.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
path.rs Move the implementation of Path::exists to sys_common::fs so platforms can specialize it 2021-05-19 23:54:56 +01:00
primitive_docs.rs remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
process.rs impl crate::error::Error for ExitStatusError 2021-05-12 11:12:20 +01:00
rt.rs Remove Once from init 2021-04-22 18:00:18 +02:00
time.rs Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00