1
Fork 0

Add closure labels

This commit is contained in:
Esteban Küber 2024-10-27 19:03:13 +00:00
parent 03e9a38390
commit 87d323c81e
5 changed files with 14 additions and 11 deletions

View file

@ -1423,10 +1423,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
// LL | Unit4
// | ^^^^^ expected `Unit3`, found `Unit4`
// |
diag.span_label(span, "");
diag.span_label(span, "this closure");
if !span.overlaps(obligation.cause.span) {
// Point at the binding corresponding to the closure where it is used.
diag.span_label(obligation.cause.span, "");
diag.span_label(obligation.cause.span, "closure used here");
}
}