1
Fork 0

Properly track ImplObligations

Instead of probing for all possible impls that could have caused an
`ImplObligation`, keep track of its `DefId` and obligation spans for
accurate error reporting.

Follow up to #89580. Addresses #89418.

Remove some unnecessary clones.

Tweak output for auto trait impl obligations.
This commit is contained in:
Esteban Kuber 2021-10-13 13:58:41 +00:00
parent 547369d3d8
commit 5fd37862d9
24 changed files with 426 additions and 218 deletions

View file

@ -31,7 +31,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
// about the original obligation only.
let code = match cause.code() {
ObligationCauseCode::FunctionArgumentObligation { parent_code, .. } => &*parent_code,
_ => cause.code(),
code => code,
};
let ObligationCauseCode::MatchImpl(parent, impl_def_id) = code else {
return None;