The main use case here is binary operator traits. "Little Orphan Impls" discusses this use case a lot but ends up arguing that ordering should matter, and it does matter in today's rules, which is a surprise people usually encounter with the binary operator traits.
Since changing which orphan rules apply to a trait would obviously be backwards incompatible (and no, even editions can't change that), we probably can't actually do this for std's operator traits. Are there any use cases with third party traits where this would help?
The main use case here is binary operator traits. "Little Orphan Impls" discusses this use case a lot but ends up arguing that ordering should matter, and it does matter in today's rules, which is a surprise people usually encounter with the binary operator traits.
https://internals.rust-lang.org/t/coherence-rules-for-generic-binary-operator-traits/4778/10 suggests that we could simply make these traits use different orphan rules where ordering does not matter. https://internals.rust-lang.org/t/orphan-rules/1322/11?u=ixrec suggests manually specifying the ordering for orphan rules separately from the actual ordering of type parameters in the public API.
Since changing which orphan rules apply to a trait would obviously be backwards incompatible (and no, even editions can't change that), we probably can't actually do this for
std
's operator traits. Are there any use cases with third party traits where this would help?