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