diff options
| author | bors <bors@rust-lang.org> | 2017-05-23 00:36:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-05-23 00:36:56 +0000 |
| commit | 2e9139197e908435673c62a14381fbd4f8166319 (patch) | |
| tree | 19b77875f70eb6c04366ac3b21ae22636f21f1d4 /src/rustllvm | |
| parent | 81734e0e06d24cf580dd5352c64d10110e4d3b7b (diff) | |
| parent | 747287a2b3b6649d59cfd11be1fb32e667f71a3f (diff) | |
| download | rust-2e9139197e908435673c62a14381fbd4f8166319.tar.gz rust-2e9139197e908435673c62a14381fbd4f8166319.zip | |
Auto merge of #41559 - GuillaumeGomez:partial-eq-msg, r=estebank
Add better error message when == operator is badly used
Part of #40660.
With the following code:
```rust
fn foo<T: PartialEq>(a: &T, b: T) {
a == b;
}
fn main() {
foo(&1, 1);
}
```
It prints:
```
error[E0277]: the trait bound `&T: std::cmp::PartialEq<T>` is not satisfied
--> test.rs:2:5
|
2 | a == b;
| ^^^^^^ can't compare `&T` with `T`
|
= help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
= help: consider adding a `where &T: std::cmp::PartialEq<T>` bound
error: aborting due to previous error
```
Diffstat (limited to 'src/rustllvm')
0 files changed, 0 insertions, 0 deletions
