Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading