From 19d4b0411687542174813d203db15bb77acca872 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 4 May 2021 23:37:50 -0400 Subject: [PATCH] Don't link to stable/beta docs for primitives This has two issues: 1. The test suite is not set up for links that differ based on the channel. This is not a giant deal; it's fixed by https://github.com/jyn514/rust/commit/2a2126475d7cb6dbdddd684032f4f67638b1efd6. 2. It's inconsistent with non-primitive types, because libstd uses `html_root_url = "rust-lang.org/nightly"`. Fixing this is non-trivial, and the usefulness has also been called into question; see https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Rustdoc.20unconditionally.20links.20to.20nightly.20libstd.20docs. To avoid being inconsistent, this reverts linking to beta for now. --- src/librustdoc/clean/types.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 350742e8f2898..47dae63f1fdf7 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -517,10 +517,9 @@ impl Item { Some(ExternalLocation::Remote(ref s)) => { format!("{}/std/", s.trim_end_matches('/')) } - Some(ExternalLocation::Unknown) | None => format!( - "https://doc.rust-lang.org/{}/std/", - crate::doc_rust_lang_org_channel(), - ), + Some(ExternalLocation::Unknown) | None => { + "https://doc.rust-lang.org/nightly/std/".to_string() + } }; // This is a primitive so the url is done "by hand". let tail = fragment.find('#').unwrap_or_else(|| fragment.len());