Skip to content

Commit 17be682

Browse files
committed
Remove TypeckMir
1 parent 6cc24f2 commit 17be682

File tree

4 files changed

+129
-190
lines changed

4 files changed

+129
-190
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ pub(super) fn generate<'gcx, 'tcx>(
4747
mir.local_decls.indices().collect()
4848
} else {
4949
let free_regions = {
50-
let borrowck_context = typeck.borrowck_context.as_ref().unwrap();
5150
regions_that_outlive_free_regions(
5251
typeck.infcx.num_region_vars(),
53-
&borrowck_context.universal_regions,
54-
&borrowck_context.constraints.outlives_constraints,
52+
&typeck.borrowck_context.universal_regions,
53+
&typeck.borrowck_context.constraints.outlives_constraints,
5554
)
5655
};
5756
compute_live_locals(typeck.tcx(), &free_regions, mir)

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -517,16 +517,15 @@ impl LivenessContext<'_, '_, '_, '_, 'tcx> {
517517

518518
let tcx = typeck.tcx();
519519
tcx.for_each_free_region(&value, |live_region| {
520-
let borrowck_context = typeck.borrowck_context.as_mut().unwrap();
521-
let live_region_vid = borrowck_context
520+
let live_region_vid = typeck.borrowck_context
522521
.universal_regions
523522
.to_region_vid(live_region);
524-
borrowck_context
523+
typeck.borrowck_context
525524
.constraints
526525
.liveness_constraints
527526
.add_elements(live_region_vid, live_at);
528527

529-
if let Some(facts) = borrowck_context.all_facts {
528+
if let Some(facts) = typeck.borrowck_context.all_facts {
530529
for point in live_at.iter() {
531530
let loc = elements.to_location(point);
532531
facts.region_live_at.push((live_region_vid, location_table.start_index(loc)));

0 commit comments

Comments
 (0)