diff options
| author | bors <bors@rust-lang.org> | 2021-10-06 06:20:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-06 06:20:25 +0000 |
| commit | d7539a6af09e5889ed9bcb8b49571b7a59c32e65 (patch) | |
| tree | 50da309ff23a14082fa4ef682197dfc42591f93d /src/test/ui/suggestions | |
| parent | 98a5a98f44130b5bafb4f2b2f3126fb22a5a3228 (diff) | |
| parent | e8fc076f231699d9a44fc44a1e298ea4f70fdb48 (diff) | |
Auto merge of #89323 - estebank:derive-binop, r=petrochenkov
Consider unfulfilled obligations in binop errors When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Fix #84515.
Diffstat (limited to 'src/test/ui/suggestions')
| -rw-r--r-- | src/test/ui/suggestions/invalid-bin-op.stderr | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/invalid-bin-op.stderr b/src/test/ui/suggestions/invalid-bin-op.stderr index 7668eddf607..d18c24e53d0 100644 --- a/src/test/ui/suggestions/invalid-bin-op.stderr +++ b/src/test/ui/suggestions/invalid-bin-op.stderr @@ -6,7 +6,16 @@ LL | let _ = s == t; | | | S<T> | +note: an implementation of `PartialEq<_>` might be missing for `S<T>` + --> $DIR/invalid-bin-op.rs:5:1 + | +LL | struct S<T>(T); + | ^^^^^^^^^^^^^^^ must implement `PartialEq<_>` = note: the trait `std::cmp::PartialEq` is not implemented for `S<T>` +help: consider annotating `S<T>` with `#[derive(PartialEq)]` + | +LL | #[derive(PartialEq)] + | error: aborting due to previous error |
