Well, for your specific case, I would just use #[derive] :
#[derive(Ord,PartialOrd,Eq,PartialEq,Debug,Copy,Clone)] struct MyType(isize); fn main() { let a = MyType(5); let b = MyType(6); println!("{:?}", a.cmp(&b)) }
If you need a special case for your implementation of Ord , you will have to write this code, nothing saves us there! You can still get implementations for other features if it makes sense to do this.
The other part of your question is ambiguous, so I will answer both paths that I read:
Why can't Ord be provided automatically with PartialOrd ?
Look at the docs for PartialOrd and Ord .
PartialOrd says: "Comparison must satisfy antisymmetry and transitivity," while Ord says: "types that form a general order." These are mathematical terms, and I will not work as well as Wikipedia in describing them.
However, as an example, we can use floating point numbers. Floats have the special meaning of NaN . Comparison with this value is difficult. For example, all 1.0 < NaN , 1.0 == NaN and 1.0 > NaN are false! They do not form a general order, but we can compare one value with another. That's why PartialOrd exists - so that we can compare types like this. PartialEq , by the way, exists for the same reasons.
We cannot define Ord in terms of PartialOrd , because we do not have the appropriate guarantees regarding the base types. This is a system like Rust, saving us from mistakes!
Why PartialOrd n't PartialOrd be automatically provided with Ord ?
The problem is that there are more types of PartialOrd than they are Ord . If we required everything to be Ord , then we could not compare any floating point values, because they do not have a common order. Or we would have to refuse the full order and lose the security that it provides.
when I implement PartialOrd (gt (), lt (), eq (), ge (), le () ...)
Note that PartialOrd has standard implementations, you need to implement cmp . The rest exist for ease of use, or perhaps because of performance.