1 #![warn(clippy::derive_ord_xor_partial_ord)]
3 use std::cmp::Ordering;
5 #[derive(PartialOrd, Ord, PartialEq, Eq)]
8 impl PartialEq<u64> for DeriveBoth {
9 fn eq(&self, _: &u64) -> bool {
14 impl PartialOrd<u64> for DeriveBoth {
15 fn partial_cmp(&self, _: &u64) -> Option<Ordering> {
20 #[derive(Ord, PartialEq, Eq)]
23 impl PartialOrd for DeriveOrd {
24 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
29 #[derive(Ord, PartialEq, Eq)]
30 struct DeriveOrdWithExplicitTypeVariable;
32 impl PartialOrd<DeriveOrdWithExplicitTypeVariable> for DeriveOrdWithExplicitTypeVariable {
33 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
38 #[derive(PartialOrd, PartialEq, Eq)]
39 struct DerivePartialOrd;
41 impl std::cmp::Ord for DerivePartialOrd {
42 fn cmp(&self, other: &Self) -> Ordering {
47 #[derive(PartialOrd, PartialEq, Eq)]
52 // We don't want to lint on user-defined traits called `Ord`
53 impl Ord for ImplUserOrd {}
56 use std::cmp::{Ord, Ordering};
58 #[derive(PartialOrd, PartialEq, Eq)]
59 struct DerivePartialOrdInUseOrd;
61 impl Ord for DerivePartialOrdInUseOrd {
62 fn cmp(&self, other: &Self) -> Ordering {