You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustdoc: it should be possible to leave "Methods From Deref" empty, as was previously the default behaviour #83133
For example, I would much rather have the documentation for my crate Staticvec look as it did here, as opposed to pulling in the docs for every single slice method as it does now.
Edit: Some additional thoughts:
even if this isn't possible for some reason, it would almost certainly be better to have the crate-native "Trait Implementations" section appear before the "Methods From Deref" section does, since "Trait Implementations" will pretty much always be describing things that are unique to the crate being documented and so actually directly relevant
a good idea might also be to have the "Methods From Deref" header amount to a clickable link that redirects to the actual primary docs for whatever is being derefed to in any case where it is being left empty, if that is still possible
Are there any details on when precisely this changed, also? I've noticed that even though the auto-generated docs on docs.rs previously left the "Methods From Deref" section empty for user-submitted crates, it was seemingly always filled out for stuff like the official libstd docs for Vec, so presumably there has always been some kind of way of controlling rustdoc's behaviour in this regard, unless I'm missing something.
I've noticed that even though the auto-generated docs on docs.rs previously left the "Methods From Deref" section empty for user-submitted crates, it was seemingly always filled out for stuff like the official libstd docs for Vec, so presumably there has always been some kind of way of controlling rustdoc's behaviour in this regard, unless I'm missing something.
Vec derefs directly to slice - maybe the user crates you're talking about always deref to Vec?
even if this isn't possible for some reason, it would almost certainly be better to have the crate-native "Trait Implementations" section appear before the "Methods From Deref" section does, since "Trait Implementations" will pretty much always be describing things that are unique to the crate being documented and so actually directly relevant
👍 I like this idea.
a good idea might also be to have the "Methods From Deref" header amount to a clickable link that redirects to the actual primary docs for whatever is being derefed to in any case where it is being left empty, if that is still possible
Hmm, I'm a little concerned the methods will be harder to find that way. We get a lot of complaints that the "Trait Implementations" section is hard to read because you have to click on the name of the trait to see what methods are available.
Hmm, I'm a little concerned the methods will be harder to find that way. We get a lot of complaints that the "Trait Implementations" section is hard to read because you have to click on the name of the trait to see what methods are available.
Yeah, that makes sense. Honestly just showing Trait Implementations before Methods From Deref in any case where both exist would likely pretty much cover the kind of thing I was mostly concerned about by itself anyways.
Honestly just showing Trait Implementations before Methods From Deref in any case where both exist would likely pretty much cover the kind of thing I was mostly concerned about by itself anyways.
Are you interested in making a PR for that? I think it would be as simple as moving
Activity
slightlyoutofphase commentedon Mar 21, 2021
Are there any details on when precisely this changed, also? I've noticed that even though the auto-generated docs on
docs.rspreviously left the "Methods From Deref" section empty for user-submitted crates, it was seemingly always filled out for stuff like the officiallibstddocs forVec, so presumably there has always been some kind of way of controllingrustdoc's behaviour in this regard, unless I'm missing something.jyn514 commentedon Mar 30, 2021
Yes, it was changed intentionally in #80653 and mentioned in the release notes: https://github.com/rust-lang/rust/blob/master/RELEASES.md#rustdoc.
Vec derefs directly to slice - maybe the user crates you're talking about always deref to Vec?
jyn514 commentedon Mar 30, 2021
👍 I like this idea.
Hmm, I'm a little concerned the methods will be harder to find that way. We get a lot of complaints that the "Trait Implementations" section is hard to read because you have to click on the name of the trait to see what methods are available.
slightlyoutofphase commentedon Mar 31, 2021
Yeah, that makes sense. Honestly just showing
Trait ImplementationsbeforeMethods From Derefin any case where both exist would likely pretty much cover the kind of thing I was mostly concerned about by itself anyways.jyn514 commentedon Mar 31, 2021
Are you interested in making a PR for that? I think it would be as simple as moving
rust/src/librustdoc/html/render/mod.rs
Lines 1934 to 1940 in a5029ac
rust/src/librustdoc/html/render/mod.rs
Lines 2001 to 2007 in a5029ac
slightlyoutofphase commentedon Apr 1, 2021
Sure, I'll take a look at it tomorrow.
slightlyoutofphase commentedon Apr 3, 2021
Got busy with some other stuff, but I've now opened a PR that make those changes, which do accomplish what you thought they would.
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-…