### What it does Checks for deriving `Ord` but implementing `PartialOrd` explicitly or vice versa. ### Why is this bad? The implementation of these traits must agree (for example for use with `sort`) so it’s probably a bad idea to use a default-generated `Ord` implementation with an explicitly defined `PartialOrd`. In particular, the following must hold for any type implementing `Ord`: ``` k1.cmp(&k2) == k1.partial_cmp(&k2).unwrap() ``` ### Example ``` #[derive(Ord, PartialEq, Eq)] struct Foo; impl PartialOrd for Foo { ... } ``` Use instead: ``` #[derive(PartialEq, Eq)] struct Foo; impl PartialOrd for Foo { fn partial_cmp(&self, other: &Foo) -> Option { Some(self.cmp(other)) } } impl Ord for Foo { ... } ``` or, if you don't need a custom ordering: ``` #[derive(Ord, PartialOrd, PartialEq, Eq)] struct Foo; ```