]> git.lizzy.rs Git - rust.git/commit
cmp: Use default methods in trait Ord, only require Ord::lt
authorblake2-ppc <blake2-ppc>
Sat, 13 Jul 2013 02:29:31 +0000 (04:29 +0200)
committerblake2-ppc <blake2-ppc>
Sat, 13 Jul 2013 04:23:38 +0000 (06:23 +0200)
commit36f20423c31601c7b2e4f94368e79f44146cb064
tree2f453243f6413acabc284a0b51403888a72edd29
parent1ee54a86171d70f439b3cf77e566150b78251bc2
cmp: Use default methods in trait Ord, only require Ord::lt

It will be simpler to implement only one method for Ord, while we also
allow implementing all four Ord methods for semantics or performance
reasons.

We only supply three default methods (and not four), because don't have
any nice error reporting for the case where at least one method must be
implemented, but it's arbitrary which.
src/libstd/cmp.rs
src/test/compile-fail/issue-3344.rs
src/test/run-pass/cmp-default.rs [new file with mode: 0644]