Add closure labels
This commit is contained in:
parent
03e9a38390
commit
87d323c81e
5 changed files with 14 additions and 11 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue