1
- use crate :: borrow_check:: location:: LocationTable ;
2
1
use crate :: borrow_check:: nll:: region_infer:: values:: { self , PointIndex , RegionValueElements } ;
3
2
use crate :: borrow_check:: nll:: type_check:: liveness:: local_use_map:: LocalUseMap ;
4
3
use crate :: borrow_check:: nll:: type_check:: liveness:: polonius;
@@ -38,7 +37,6 @@ pub(super) fn trace(
38
37
flow_inits : & mut FlowAtLocation < ' tcx , MaybeInitializedPlaces < ' _ , ' tcx > > ,
39
38
move_data : & MoveData < ' tcx > ,
40
39
live_locals : Vec < Local > ,
41
- location_table : & LocationTable ,
42
40
) {
43
41
debug ! ( "trace()" ) ;
44
42
@@ -52,7 +50,6 @@ pub(super) fn trace(
52
50
local_use_map,
53
51
move_data,
54
52
drop_data : FxHashMap :: default ( ) ,
55
- location_table,
56
53
} ;
57
54
58
55
LivenessResults :: new ( cx) . compute_for_all_locals ( live_locals) ;
@@ -82,9 +79,6 @@ struct LivenessContext<'me, 'typeck, 'flow, 'tcx> {
82
79
/// Index indicating where each variable is assigned, used, or
83
80
/// dropped.
84
81
local_use_map : & ' me LocalUseMap ,
85
-
86
- /// Maps between a MIR Location and a LocationIndex
87
- location_table : & ' me LocationTable ,
88
82
}
89
83
90
84
struct DropData < ' tcx > {
@@ -405,7 +399,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
405
399
& mut self . typeck ,
406
400
value,
407
401
live_at,
408
- self . location_table ,
409
402
)
410
403
}
411
404
@@ -462,7 +455,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
462
455
& mut self . typeck ,
463
456
kind,
464
457
live_at,
465
- self . location_table ,
466
458
) ;
467
459
468
460
polonius:: add_var_drops_regions ( & mut self . typeck , dropped_local, & kind) ;
@@ -474,7 +466,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
474
466
typeck : & mut TypeChecker < ' _ , ' tcx > ,
475
467
value : impl TypeFoldable < ' tcx > ,
476
468
live_at : & HybridBitSet < PointIndex > ,
477
- location_table : & LocationTable ,
478
469
) {
479
470
debug ! ( "make_all_regions_live(value={:?})" , value) ;
480
471
debug ! (
@@ -491,15 +482,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
491
482
. constraints
492
483
. liveness_constraints
493
484
. add_elements ( live_region_vid, live_at) ;
494
-
495
- // FIXME: remove this when we can generate our own region-live-at reliably
496
- if let Some ( facts) = typeck. borrowck_context . all_facts {
497
- for point in live_at. iter ( ) {
498
- let loc = elements. to_location ( point) ;
499
- facts. region_live_at . push ( ( live_region_vid, location_table. start_index ( loc) ) ) ;
500
- facts. region_live_at . push ( ( live_region_vid, location_table. mid_index ( loc) ) ) ;
501
- }
502
- }
503
485
} ) ;
504
486
}
505
487
0 commit comments