rustdoc should versionsort types in trait implementations #67046
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
In reading the documentation for
std::num::Wrapping
, I noticed (in the left sidebar) a list of trait implementations forWrapping
of various numeric types, which appeared in this order:Wrapping<i128>
Wrapping<i16>
Wrapping<i32>
Wrapping<i64>
Wrapping<i8>
Wrapping<isize>
This seems to sort numbers as strings, rather than by numeric value.
I would propose that everywhere rustdoc sorts identifiers of any kind, it should always use the versionsort algorithm, which sorts numbers by numeric value rather than as strings.
The commit at rust-lang/rustfmt#3764 contains an implementation of the versionsort comparison algorithm. I would suggest putting that (and its tests) into a common implementation for rustdoc and other future callers like rustfmt.
The text was updated successfully, but these errors were encountered: