Let's look at this from a mathematical p.o.v.
There are partial orders and weak orders (in form of a "strict weak order", or a "non-strict weak order", of which the latter is also called "total preorder", see linked Wikipedia article).
IMHO sorting a slice based on a partial order usually makes no sense because there could be two subsets which each can be sorted, but there is no relation between two elements when each of these elements is in a different of the two subsets.
For example:
- USD 50.00, USD 43.22, EUR 1.00, EUR 2.00
We could define a partial order where equal currencies can be compared, while different currencies don't compare. Possible sorting results could be:
- USD 43.22, USD 50.00, EUR 1.00, EUR 2.00
- EUR 1.00, EUR 2.00, USD 43.22, USD 50.00
I would claim that it is semantically wrong to call this "sorting" the list. I would say you could "partially" sort it (which is something different than an "unstable" sort).
However, if we have a weak order, e.g. ordering rectangles based on their area, then we could easily sort these. But there is no trait for a weak order in Rust!