doc request: stable doc pages should link to nightly docs for nightly-only features #42380
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
Today I was trying to puzzle out why I was getting this error:
Googling for "rust std::ops::RangeInclusive" sent me here:
https://doc.rust-lang.org/std/ops/enum.RangeInclusive.html
and I kept staring at this definition, saying "why is
rustc
complaining about my use of this enum?"I briefly wondered if maybe I was looking at an outdated version of the docs, but the url seemed official, and the page even said "This is a nightly-only experimental API.", which made me say "okay these docs even know that this type is for nightly-use only, so this must reflect what the nightly compiler is seeing."
However, my reasoning there was completely bogus.
Those doc pages above are for the last stable release. Which does not reflect changes that have happened to the nightly compiler, even though they are advertising stdlib types that are only available in nightly (and thus may have diverged from the given documentation).
The url I should have wanted is:
https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html
So, my thought:
Should features available solely in the nightly compiler either be filtered out from the stable docs, or, alternatively, should they include a link to the nightly docs?
(Adding such a link automatically may be tricky in a case like this, where the embedded within the two urls is the distinction between whether
RangeInclusive
is anenum
orstruct
. But maybe we would just implement this forward link within the#[unstable]
attribute, where it could be manually adjusted to reflect such changes?)(Unfortunately, revising my google search to: "rust nightly std::ops::RangeInclusive" still has the same (stable docs) url as the first result; the nightly docs come up second there.)
The text was updated successfully, but these errors were encountered: