summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/cmp_owned/asymmetric_partial_eq.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/cmp_owned/asymmetric_partial_eq.stderr')
-rw-r--r--src/tools/clippy/tests/ui/cmp_owned/asymmetric_partial_eq.stderr46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/cmp_owned/asymmetric_partial_eq.stderr b/src/tools/clippy/tests/ui/cmp_owned/asymmetric_partial_eq.stderr
new file mode 100644
index 000000000..43bf8851f
--- /dev/null
+++ b/src/tools/clippy/tests/ui/cmp_owned/asymmetric_partial_eq.stderr
@@ -0,0 +1,46 @@
+error: this creates an owned instance just for comparison
+ --> $DIR/asymmetric_partial_eq.rs:42:12
+ |
+LL | if borrowed.to_owned() == owned {}
+ | ^^^^^^^^^^^^^^^^^^^ help: try: `borrowed`
+ |
+ = note: `-D clippy::cmp-owned` implied by `-D warnings`
+
+error: this creates an owned instance just for comparison
+ --> $DIR/asymmetric_partial_eq.rs:43:21
+ |
+LL | if owned == borrowed.to_owned() {}
+ | ---------^^^^^^^^^^^^^^^^^^^
+ | |
+ | help: try: `borrowed == owned`
+
+error: this creates an owned instance just for comparison
+ --> $DIR/asymmetric_partial_eq.rs:61:21
+ |
+LL | if owned == borrowed.to_owned() {}
+ | ^^^^^^^^^^^^^^^^^^^ help: try: `borrowed`
+
+error: this creates an owned instance just for comparison
+ --> $DIR/asymmetric_partial_eq.rs:62:12
+ |
+LL | if borrowed.to_owned() == owned {}
+ | ^^^^^^^^^^^^^^^^^^^---------
+ | |
+ | help: try: `owned == borrowed`
+
+error: this creates an owned instance just for comparison
+ --> $DIR/asymmetric_partial_eq.rs:88:20
+ |
+LL | if "Hi" == borrowed.to_string() {}
+ | --------^^^^^^^^^^^^^^^^^^^^
+ | |
+ | help: try: `borrowed == "Hi"`
+
+error: this creates an owned instance just for comparison
+ --> $DIR/asymmetric_partial_eq.rs:89:12
+ |
+LL | if borrowed.to_string() == "Hi" {}
+ | ^^^^^^^^^^^^^^^^^^^^ help: try: `borrowed`
+
+error: aborting due to 6 previous errors
+