[rustdoc] Sort impl associated items by kinds and then by appearance by GuillaumeGomez · Pull Request #129471 · rust-lang/rust (original) (raw)
Following this zulip discussion, I implemented it.
This brings the following change: impl associated items will now be grouped by kind and will now be first sorted by kind and then by the order they are declared in the source code (like currently).
The kinds are sorted in the following order:
- Constants
- Types
- Functions
The reason behind this order is that associated constants can be used in associated types (like length in arrays) and both associated types and associated constants can be used in associated functions. So if an associated item from the same impl is used, its definition will always be above where it's being used.
cc @camelid
r? @notriddle