blob: 4978d7a87396069d8de2a3cbee23910cee556e61 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
error: non-canonical implementation of `partial_cmp` on an `Ord` type
--> $DIR/non_canonical_partial_ord_impl_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: `-D clippy::non-canonical-partial-ord-impl` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::non_canonical_partial_ord_impl)]`
error: non-canonical implementation of `partial_cmp` on an `Ord` type
--> $DIR/non_canonical_partial_ord_impl_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
|