Skip to content

Commit 9cd1a11

Browse files
author
Albin Stjerna
committed
Polonius: don't emit region_live_at
1 parent 6568b08 commit 9cd1a11

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

src/librustc_mir/borrow_check/nll/facts.rs

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl AllFactsExt for AllFacts {
5858
cfg_edge,
5959
killed,
6060
outlives,
61-
region_live_at,
6261
invalidates,
6362
var_used,
6463
var_defined,

src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(super) fn generate<'tcx>(
5858
};
5959

6060
if !live_locals.is_empty() {
61-
trace::trace(typeck, body, elements, flow_inits, move_data, live_locals, location_table);
61+
trace::trace(typeck, body, elements, flow_inits, move_data, live_locals);
6262

6363
polonius::populate_var_liveness_facts(typeck, body, location_table);
6464
}

src/librustc_mir/borrow_check/nll/type_check/liveness/trace.rs

-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::borrow_check::location::LocationTable;
21
use crate::borrow_check::nll::region_infer::values::{self, PointIndex, RegionValueElements};
32
use crate::borrow_check::nll::type_check::liveness::local_use_map::LocalUseMap;
43
use crate::borrow_check::nll::type_check::liveness::polonius;
@@ -38,7 +37,6 @@ pub(super) fn trace(
3837
flow_inits: &mut FlowAtLocation<'tcx, MaybeInitializedPlaces<'_, 'tcx>>,
3938
move_data: &MoveData<'tcx>,
4039
live_locals: Vec<Local>,
41-
location_table: &LocationTable,
4240
) {
4341
debug!("trace()");
4442

@@ -52,7 +50,6 @@ pub(super) fn trace(
5250
local_use_map,
5351
move_data,
5452
drop_data: FxHashMap::default(),
55-
location_table,
5653
};
5754

5855
LivenessResults::new(cx).compute_for_all_locals(live_locals);
@@ -82,9 +79,6 @@ struct LivenessContext<'me, 'typeck, 'flow, 'tcx> {
8279
/// Index indicating where each variable is assigned, used, or
8380
/// dropped.
8481
local_use_map: &'me LocalUseMap,
85-
86-
/// Maps between a MIR Location and a LocationIndex
87-
location_table: &'me LocationTable,
8882
}
8983

9084
struct DropData<'tcx> {
@@ -405,7 +399,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
405399
&mut self.typeck,
406400
value,
407401
live_at,
408-
self.location_table,
409402
)
410403
}
411404

@@ -462,7 +455,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
462455
&mut self.typeck,
463456
kind,
464457
live_at,
465-
self.location_table,
466458
);
467459

468460
polonius::add_var_drops_regions(&mut self.typeck, dropped_local, &kind);
@@ -474,7 +466,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
474466
typeck: &mut TypeChecker<'_, 'tcx>,
475467
value: impl TypeFoldable<'tcx>,
476468
live_at: &HybridBitSet<PointIndex>,
477-
location_table: &LocationTable,
478469
) {
479470
debug!("make_all_regions_live(value={:?})", value);
480471
debug!(
@@ -491,15 +482,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
491482
.constraints
492483
.liveness_constraints
493484
.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-
}
503485
});
504486
}
505487

0 commit comments

Comments
 (0)