Skip to content

Commit 37c2657

Browse files
committed
Add comment
1 parent f0e5c95 commit 37c2657

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/borrow_check/error_reporting.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
177177
_ => return None,
178178
};
179179

180+
181+
// When a closure upvar is assigned, it generates the necessary borrows and moves just
182+
// above it and they all have the same span (including the upvar assignment). So, we are
183+
// searching for closure upvar assignment.
180184
for stmt in &self.mir[location.block].statements[location.statement_index + 1..] {
181185
if maybe_closure_span != stmt.source_info.span {
182186
break;

0 commit comments

Comments
 (0)