Skip to content

Commit

Permalink
Remove TypeckMir
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 3, 2019
1 parent 6cc24f2 commit 17be682
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 190 deletions.
5 changes: 2 additions & 3 deletions src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs
Expand Up @@ -47,11 +47,10 @@ pub(super) fn generate<'gcx, 'tcx>(
mir.local_decls.indices().collect()
} else {
let free_regions = {
let borrowck_context = typeck.borrowck_context.as_ref().unwrap();
regions_that_outlive_free_regions(
typeck.infcx.num_region_vars(),
&borrowck_context.universal_regions,
&borrowck_context.constraints.outlives_constraints,
&typeck.borrowck_context.universal_regions,
&typeck.borrowck_context.constraints.outlives_constraints,
)
};
compute_live_locals(typeck.tcx(), &free_regions, mir)
Expand Down
Expand Up @@ -517,16 +517,15 @@ impl LivenessContext<'_, '_, '_, '_, 'tcx> {

let tcx = typeck.tcx();
tcx.for_each_free_region(&value, |live_region| {
let borrowck_context = typeck.borrowck_context.as_mut().unwrap();
let live_region_vid = borrowck_context
let live_region_vid = typeck.borrowck_context
.universal_regions
.to_region_vid(live_region);
borrowck_context
typeck.borrowck_context
.constraints
.liveness_constraints
.add_elements(live_region_vid, live_at);

if let Some(facts) = borrowck_context.all_facts {
if let Some(facts) = typeck.borrowck_context.all_facts {
for point in live_at.iter() {
let loc = elements.to_location(point);
facts.region_live_at.push((live_region_vid, location_table.start_index(loc)));
Expand Down

0 comments on commit 17be682

Please sign in to comment.