Use tcx.hir() utils for spans in MIR building.
This corrects the `span_with_body` in the case of closures, which was incorrectly shortened to the `def_span`.
This commit is contained in:
parent
ffe20d61d6
commit
1f370d9437
49 changed files with 352 additions and 298 deletions
|
@ -360,7 +360,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
|
||||
diag.span_label(upvar_span, "captured outer variable");
|
||||
diag.span_label(
|
||||
self.body.span,
|
||||
self.infcx.tcx.def_span(def_id),
|
||||
format!("captured by this `{closure_kind}` closure"),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue