Skip to content

Commit

Permalink
Don't link to stable/beta docs for primitives
Browse files Browse the repository at this point in the history
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
jyn514@2a21264.
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.
  • Loading branch information
jyn514 committed May 5, 2021
1 parent ae8b84b commit 19d4b04
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 19d4b04

Please sign in to comment.