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: "Methods from Deref<...>" too low on sidebar #85618
Ah, looks like this was intentional in #83826, after conversation in #83133. Removing C-bug and regression-from-stable-to-beta. Keeping this open as a discussion issue: I think putting "Methods from Deref" further down than trait implementations is wrong for String, because so many of its important methods are on str. I'd like to either reconsider #83133 or find some way to make this work nicely for String. Vec is probably in the same boat, with its impl Deref<Target = [T]>.
I'd like to voice that I also think this is a kind of regression. 99% of the time I go to a type's page, I'm looking for methods, not traits; I've gotten used to seeing str's methods directly under Strings, and it feels like a mistake moving away from this.
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
The problem with this is sometimes the "Methods from Deref" section refers to a type in the crate. Particularly for Vec and String, about half of the most useful methods are on [T] and str, respectively.
Those are types that are a critical part of the new user learning path, and it's a good user experience for those to be right next to the other methods, both in the sidebar and in the doc.
I suspect there are other ways to solve the need expressed in #83133 without affecting the page layout of Vec and String in this way.
I suspect there are other ways to solve the need expressed in #83133 without affecting the page layout of Vec and String in this way.
FWIW, I originally opened that issue with something more like a directly configurable way of specifying the page layout order for your own crate in mind. I still think that would ultimately be the best solution here. Unsure what the best approach would be, though, as far as top level attribute vs. command-line flag vs. any other way of doing it.
Other stuff like what is and isn't "collapsed" by default should probably be configurable also, I'd say.
Activity
jsha commentedon May 24, 2021
Ah, looks like this was intentional in #83826, after conversation in #83133. Removing C-bug and regression-from-stable-to-beta. Keeping this open as a discussion issue: I think putting "Methods from Deref" further down than trait implementations is wrong for String, because so many of its important methods are on
str. I'd like to either reconsider #83133 or find some way to make this work nicely for String. Vec is probably in the same boat, with itsimpl Deref<Target = [T]>.ilyvion commentedon May 24, 2021
I'd like to voice that I also think this is a kind of regression. 99% of the time I go to a type's page, I'm looking for methods, not traits; I've gotten used to seeing
str's methods directly underStrings, and it feels like a mistake moving away from this.jsha commentedon Jun 13, 2021
@jyn514, @slightlyoutofphase, what do you think of reverting #83826 while we look for a better solution. From #83133:
The problem with this is sometimes the "Methods from Deref" section refers to a type in the crate. Particularly for Vec and String, about half of the most useful methods are on
[T]andstr, respectively.Those are types that are a critical part of the new user learning path, and it's a good user experience for those to be right next to the other methods, both in the sidebar and in the doc.
I suspect there are other ways to solve the need expressed in #83133 without affecting the page layout of Vec and String in this way.
jyn514 commentedon Jun 21, 2021
@jsha that's fine - #83826 was a response to #80653, which has since been reverted.
Auto merge of rust-lang#86564 - jsha:revert-83826, r=jyn514
slightlyoutofphase commentedon Dec 23, 2021
FWIW, I originally opened that issue with something more like a directly configurable way of specifying the page layout order for your own crate in mind. I still think that would ultimately be the best solution here. Unsure what the best approach would be, though, as far as top level attribute vs. command-line flag vs. any other way of doing it.
Other stuff like what is and isn't "collapsed" by default should probably be configurable also, I'd say.