Open
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.