1 #![warn(clippy::derive_ord_xor_partial_ord)]
2 #![allow(clippy::unnecessary_wraps)]
4 use std::cmp::Ordering;
6 #[derive(PartialOrd, Ord, PartialEq, Eq)]
9 impl PartialEq<u64> for DeriveBoth {
10 fn eq(&self, _: &u64) -> bool {
15 impl PartialOrd<u64> for DeriveBoth {
16 fn partial_cmp(&self, _: &u64) -> Option<Ordering> {
21 #[derive(Ord, PartialEq, Eq)]
24 impl PartialOrd for DeriveOrd {
25 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
30 #[derive(Ord, PartialEq, Eq)]
31 struct DeriveOrdWithExplicitTypeVariable;
33 impl PartialOrd<DeriveOrdWithExplicitTypeVariable> for DeriveOrdWithExplicitTypeVariable {
34 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
39 #[derive(PartialOrd, PartialEq, Eq)]
40 struct DerivePartialOrd;
42 impl std::cmp::Ord for DerivePartialOrd {
43 fn cmp(&self, other: &Self) -> Ordering {
48 #[derive(PartialOrd, PartialEq, Eq)]
53 // We don't want to lint on user-defined traits called `Ord`
54 impl Ord for ImplUserOrd {}
57 use std::cmp::{Ord, Ordering};
59 #[derive(PartialOrd, PartialEq, Eq)]
60 struct DerivePartialOrdInUseOrd;
62 impl Ord for DerivePartialOrdInUseOrd {
63 fn cmp(&self, other: &Self) -> Ordering {