about summary refs log tree commit diff
path: root/src/librustdoc/clean/utils.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-04 06:13:57 +0100
committerGitHub <noreply@github.com>2025-02-04 06:13:57 +0100
commitf8f31faeb75b739f8aa1e425c3115f4e8906fd7a (patch)
treea569095d5cc8fde3ef35b08edd1bac3e6ed9a953 /src/librustdoc/clean/utils.rs
parentaffdb59607566c1615c829eea9e7b27a093994ec (diff)
parenta063cf5f1c151873f753905c75d8e67115308f9d (diff)
downloadrust-f8f31faeb75b739f8aa1e425c3115f4e8906fd7a.tar.gz
rust-f8f31faeb75b739f8aa1e425c3115f4e8906fd7a.zip
Rollup merge of #134807 - poliorcetics:ab/push-skpynvsmwkll, r=camelid
fix(rustdoc): always use a channel when linking to doc.rust-lang.org

Closes #131971

I manually checked the resulting links

One issue is that this will create `nightly/...` links in places that formerly linked to stable, is that ok ? (the `slice` and `array` links in the search help notably)
Diffstat (limited to 'src/librustdoc/clean/utils.rs')
-rw-r--r--src/librustdoc/clean/utils.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index 0b4fd9c2258..f1921b90cc6 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -588,9 +588,9 @@ pub(crate) fn attrs_have_doc_flag<'a>(
 /// so that the channel is consistent.
 ///
 /// Set by `bootstrap::Builder::doc_rust_lang_org_channel` in order to keep tests passing on beta/stable.
-pub(crate) const DOC_RUST_LANG_ORG_CHANNEL: &str = env!("DOC_RUST_LANG_ORG_CHANNEL");
-pub(crate) static DOC_CHANNEL: Lazy<&'static str> =
-    Lazy::new(|| DOC_RUST_LANG_ORG_CHANNEL.rsplit('/').find(|c| !c.is_empty()).unwrap());
+pub(crate) const DOC_RUST_LANG_ORG_VERSION: &str = env!("DOC_RUST_LANG_ORG_CHANNEL");
+pub(crate) static RUSTDOC_VERSION: Lazy<&'static str> =
+    Lazy::new(|| DOC_RUST_LANG_ORG_VERSION.rsplit('/').find(|c| !c.is_empty()).unwrap());
 
 /// Render a sequence of macro arms in a format suitable for displaying to the user
 /// as part of an item declaration.