blob: f4374c28128777c5fd85503065d0e5fb083e9fb0 [file] [log] [blame]
error: incorrect implementation of `partial_cmp` on an `Ord` type
--> $DIR/incorrect_partial_ord_impl_on_ord_type_fully_qual.rs:23:1
|
LL | / impl PartialOrd for A {
LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
| | _____________________________________________________________-
LL | || // NOTE: This suggestion is wrong, as `Ord` is not in scope. But this should be fine as it isn't
LL | || // automatically applied
LL | || todo!();
LL | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
LL | | }
| |__^
|
= note: `#[deny(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default
error: incorrect implementation of `partial_cmp` on an `Ord` type
--> $DIR/incorrect_partial_ord_impl_on_ord_type_fully_qual.rs:46:1
|
LL | / impl PartialOrd for B {
LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
| | _____________________________________________________________-
LL | || // This calls `B.cmp`, not `Ord::cmp`!
LL | || Some(self.cmp(other))
LL | || }
| ||_____- help: change this to: `{ Some(std::cmp::Ord::cmp(self, other)) }`
LL | | }
| |__^
error: aborting due to 2 previous errors