Revert closure mismatch spans
This commit is contained in:
parent
3a1aa3c76e
commit
52e2065ed4
9 changed files with 94 additions and 133 deletions
|
@ -1630,6 +1630,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
{
|
||||
return;
|
||||
}
|
||||
// Skip over closure arg mismatch, which has a better heuristic
|
||||
// to determine what span to point at.
|
||||
if let traits::FulfillmentErrorCode::CodeSelectionError(
|
||||
traits::SelectionError::OutputTypeParameterMismatch(_, expected, _),
|
||||
) = error.code
|
||||
&& let ty::Closure(..) | ty::Generator(..) = expected.skip_binder().self_ty().kind()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
let Some(unsubstituted_pred) =
|
||||
self.tcx.predicates_of(def_id).instantiate_identity(self.tcx).predicates.into_iter().nth(idx) else { return; };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue