2023-09-12 16:13:53 +00:00
|
|
|
error: non-canonical implementation of `partial_cmp` on an `Ord` type
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/non_canonical_partial_ord_impl.rs:16:1
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
|
LL | / impl PartialOrd for A {
|
|
|
|
LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
|
|
|
| | _____________________________________________________________-
|
|
|
|
LL | || todo!();
|
|
|
|
LL | || }
|
|
|
|
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
|
|
|
|
LL | | }
|
|
|
|
| |__^
|
|
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
= note: `-D clippy::non-canonical-partial-ord-impl` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::non_canonical_partial_ord_impl)]`
|
2023-07-17 08:19:29 +00:00
|
|
|
|
2023-09-12 16:13:53 +00:00
|
|
|
error: non-canonical implementation of `partial_cmp` on an `Ord` type
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/non_canonical_partial_ord_impl.rs:50:1
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
|
LL | / impl PartialOrd for C {
|
|
|
|
LL | | fn partial_cmp(&self, _: &Self) -> Option<Ordering> {
|
|
|
|
LL | | todo!();
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
help: change this to
|
|
|
|
|
|
|
|
|
LL | fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
|
|
|
|
| ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|