You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(PartialEq)]structFoo;fnmain(){let x = &Foo;assert!(x == Foo);}
yields
error[E0277]: the trait bound `&Foo: std::cmp::PartialEq<Foo>` is not satisfied
--> <anon>:6:13
|
6 | assert!(x == Foo);
| ^^^^^^^^
|
= help: the following implementations were found:
= help: <Foo as std::cmp::PartialEq>
Which is either fixed by adding an ampersand before the second argument or a deref before the first
The error message should suggest to insert one or multiple derefs before the argument that has more references than the other. This is a regular issue I get from Rust newcomers.
The text was updated successfully, but these errors were encountered:
Explicit help message for binop type mismatch
When trying to do `1 + Some(2)`, or some other binary operation on two
types different types without an appropriate trait implementation, provide
an explicit help message:
```rust
help: `{integer} + std::option::Option<{integer}>` has no implementation
```
Re: #39579, #38564, #37626, #39942, #34698.
We don't currently have any suggestion to dereference x... error message is below.
error[E0277]: the trait bound `&Foo: std::cmp::PartialEq<Foo>` is not satisfied
--> test.rs:6:13
|
6 | assert!(x == Foo);
| ^^^^^^^^ the trait `std::cmp::PartialEq<Foo>` is not implemented for `&Foo`
|
= note: can't compare `&Foo` with `Foo`
error: aborting due to previous error
Let's start off with an example:
yields
Which is either fixed by adding an ampersand before the second argument or a deref before the first
The error message should suggest to insert one or multiple derefs before the argument that has more references than the other. This is a regular issue I get from Rust newcomers.
The text was updated successfully, but these errors were encountered: