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.
This commit is contained in:
bors 2021-10-06 06:20:25 +00:00
commit d7539a6af0
27 changed files with 667 additions and 108 deletions

View file

@ -521,7 +521,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
"this error might have been caused by changes to \
Rust's type-inference algorithm (see issue #48950 \
<https://github.com/rust-lang/rust/issues/48950> \
for more information).",
for more information)",
);
err.help("did you intend to use the type `()` here instead?");
}