about summary refs log tree commit diff
path: root/tests/ui/partialeq_help.stderr
diff options
context:
space:
mode:
authorsjwang05 <63834813+sjwang05@users.noreply.github.com>2023-12-16 17:34:52 -0800
committersjwang05 <63834813+sjwang05@users.noreply.github.com>2023-12-16 19:56:50 -0800
commit2618e0f805bda52ef07704872d9751ee22e40eda (patch)
tree8fde21860916d781253eeceb4f577ddf0e6e9192 /tests/ui/partialeq_help.stderr
parentde686cbc65478db53e3d51c52497685e852cc092 (diff)
downloadrust-2618e0f805bda52ef07704872d9751ee22e40eda.tar.gz
rust-2618e0f805bda52ef07704872d9751ee22e40eda.zip
Provide better suggestions for T == &T and &T == T
Diffstat (limited to 'tests/ui/partialeq_help.stderr')
-rw-r--r--tests/ui/partialeq_help.stderr8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/partialeq_help.stderr b/tests/ui/partialeq_help.stderr
index fdff94f425c..f5de1308e87 100644
--- a/tests/ui/partialeq_help.stderr
+++ b/tests/ui/partialeq_help.stderr
@@ -5,6 +5,10 @@ LL |     a == b;
    |       ^^ no implementation for `&T == T`
    |
    = help: the trait `PartialEq<T>` is not implemented for `&T`
+help: consider dereferencing here
+   |
+LL |     *a == b;
+   |     +
 help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
    |
 LL | fn foo<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
@@ -17,6 +21,10 @@ LL |     a == b;
    |       ^^ no implementation for `&T == T`
    |
    = help: the trait `PartialEq<T>` is not implemented for `&T`
+help: consider dereferencing here
+   |
+LL |     *a == b;
+   |     +
 help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
    |
 LL | fn foo2<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {