@@ -317,7 +317,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
317
317
}
318
318
319
319
fn visit_block_entry ( & mut self , bb : BasicBlock , flow_state : & Self :: FlowState ) {
320
- debug ! ( "MirBorrowckCtxt::process_block ({:?}): {}" , bb, flow_state) ;
320
+ debug ! ( "MirBorrowckCtxt::visit_block_entry ({:?}): {}" , bb, flow_state) ;
321
321
}
322
322
323
323
fn visit_statement_entry (
@@ -327,7 +327,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
327
327
flow_state : & Self :: FlowState ,
328
328
) {
329
329
debug ! (
330
- "MirBorrowckCtxt::process_statement ({:?}, {:?}): {}" ,
330
+ "MirBorrowckCtxt::visit_statement_entry ({:?}, {:?}): {}" ,
331
331
location,
332
332
stmt,
333
333
flow_state
@@ -1127,6 +1127,11 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1127
1127
BorrowKind :: Unique | BorrowKind :: Mut => { }
1128
1128
}
1129
1129
1130
+ // If this is already activated, no need to do further checks.
1131
+ if flow_state. borrows . contains ( & gen) {
1132
+ return ;
1133
+ }
1134
+
1130
1135
self . access_place (
1131
1136
ContextKind :: Activation . new ( location) ,
1132
1137
( & borrow. borrowed_place , span) ,
0 commit comments