Skip to content

Commit f724215

Browse files
committed
partialeq_help
1 parent c53d127 commit f724215

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tests/ui/traits/partialeq-ref-mismatch-diagnostic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
//! Check diagnostic messages for `PartialEq` trait bound mismatches between `&T` and `T`.
2+
13
fn foo<T: PartialEq>(a: &T, b: T) {
24
a == b; //~ ERROR E0277
35
}
46

5-
fn foo2<T: PartialEq>(a: &T, b: T) where {
7+
fn foo2<T: PartialEq>(a: &T, b: T) {
68
a == b; //~ ERROR E0277
79
}
810

tests/ui/traits/partialeq-ref-mismatch-diagnostic.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: can't compare `&T` with `T`
2-
--> $DIR/partialeq_help.rs:2:7
2+
--> $DIR/partialeq-ref-mismatch-diagnostic.rs:4:7
33
|
44
LL | a == b;
55
| ^^ no implementation for `&T == T`
@@ -15,7 +15,7 @@ LL | fn foo<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
1515
| ++++++++++++++++++++++
1616

1717
error[E0277]: can't compare `&T` with `T`
18-
--> $DIR/partialeq_help.rs:6:7
18+
--> $DIR/partialeq-ref-mismatch-diagnostic.rs:8:7
1919
|
2020
LL | a == b;
2121
| ^^ no implementation for `&T == T`
@@ -25,10 +25,10 @@ help: consider dereferencing here
2525
|
2626
LL | *a == b;
2727
| +
28-
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
28+
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
2929
|
3030
LL | fn foo2<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
31-
| ++++++++++++++++
31+
| ++++++++++++++++++++++
3232

3333
error: aborting due to 2 previous errors
3434

0 commit comments

Comments
 (0)