@@ -216,8 +216,7 @@ fn do_mir_borrowck<'tcx>(
216
216
nll:: replace_regions_in_mir ( & infcx, param_env, & mut body_owned, & mut promoted) ;
217
217
let body = & body_owned; // no further changes
218
218
219
- let location_table_owned = LocationTable :: new ( body) ;
220
- let location_table = & location_table_owned;
219
+ let location_table = LocationTable :: new ( body) ;
221
220
222
221
let move_data = MoveData :: gather_moves ( body, tcx, param_env, |_| true ) ;
223
222
let promoted_move_data = promoted
@@ -249,7 +248,7 @@ fn do_mir_borrowck<'tcx>(
249
248
free_regions,
250
249
body,
251
250
& promoted,
252
- location_table,
251
+ & location_table,
253
252
param_env,
254
253
& mut flow_inits,
255
254
& mdpe. move_data ,
@@ -313,7 +312,7 @@ fn do_mir_borrowck<'tcx>(
313
312
param_env,
314
313
body : promoted_body,
315
314
move_data : & move_data,
316
- location_table, // no need to create a real one for the promoted, it is not used
315
+ location_table : & location_table , // no need to create a real one for the promoted, it is not used
317
316
movable_coroutine,
318
317
fn_self_span_reported : Default :: default ( ) ,
319
318
locals_are_invalidated_at_exit,
@@ -354,7 +353,7 @@ fn do_mir_borrowck<'tcx>(
354
353
param_env,
355
354
body,
356
355
move_data : & mdpe. move_data ,
357
- location_table,
356
+ location_table : & location_table ,
358
357
movable_coroutine,
359
358
locals_are_invalidated_at_exit,
360
359
fn_self_span_reported : Default :: default ( ) ,
@@ -456,7 +455,7 @@ fn do_mir_borrowck<'tcx>(
456
455
promoted,
457
456
borrow_set,
458
457
region_inference_context : regioncx,
459
- location_table : polonius_input. as_ref ( ) . map ( |_| location_table_owned ) ,
458
+ location_table : polonius_input. as_ref ( ) . map ( |_| location_table ) ,
460
459
input_facts : polonius_input,
461
460
output_facts,
462
461
} ) )
@@ -1041,9 +1040,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1041
1040
flow_state : & Flows < ' cx , ' tcx > ,
1042
1041
) -> bool {
1043
1042
let mut error_reported = false ;
1044
- let tcx = self . infcx . tcx ;
1045
- let body = self . body ;
1046
- let borrow_set = self . borrow_set . clone ( ) ;
1043
+ let borrow_set = Rc :: clone ( & self . borrow_set ) ;
1047
1044
1048
1045
// Use polonius output if it has been enabled.
1049
1046
let mut polonius_output;
@@ -1060,8 +1057,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1060
1057
1061
1058
each_borrow_involving_path (
1062
1059
self ,
1063
- tcx,
1064
- body,
1060
+ self . infcx . tcx ,
1061
+ self . body ,
1065
1062
location,
1066
1063
( sd, place_span. 0 ) ,
1067
1064
& borrow_set,
0 commit comments