summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr')
-rw-r--r--src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr b/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr
new file mode 100644
index 000000000..4978d7a87
--- /dev/null
+++ b/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.stderr
@@ -0,0 +1,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
+