-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
In reading the documentation for std::num::Wrapping
, I noticed (in the left sidebar) a list of trait implementations for Wrapping
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.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.