@@ -47,13 +47,12 @@ pub(super) fn trace<'a, 'tcx>(
47
47
48
48
// When using `-Zpolonius=next`, compute the set of loans that can reach a given region.
49
49
if typeck. tcx ( ) . sess . opts . unstable_opts . polonius . is_next_enabled ( ) {
50
- let borrowck_context = & mut typeck. borrowck_context ;
51
- let borrow_set = & borrowck_context. borrow_set ;
50
+ let borrow_set = & typeck. borrow_set ;
52
51
let mut live_loans = LiveLoans :: new ( borrow_set. len ( ) ) ;
53
- let outlives_constraints = & borrowck_context . constraints . outlives_constraints ;
52
+ let outlives_constraints = & typeck . constraints . outlives_constraints ;
54
53
let graph = outlives_constraints. graph ( typeck. infcx . num_region_vars ( ) ) ;
55
54
let region_graph =
56
- graph. region_graph ( outlives_constraints, borrowck_context . universal_regions . fr_static ) ;
55
+ graph. region_graph ( outlives_constraints, typeck . universal_regions . fr_static ) ;
57
56
58
57
// Traverse each issuing region's constraints, and record the loan as flowing into the
59
58
// outlived region.
@@ -73,7 +72,7 @@ pub(super) fn trace<'a, 'tcx>(
73
72
74
73
// Store the inflowing loans in the liveness constraints: they will be used to compute live
75
74
// loans when liveness data is recorded there.
76
- borrowck_context . constraints . liveness_constraints . loans = Some ( live_loans) ;
75
+ typeck . constraints . liveness_constraints . loans = Some ( live_loans) ;
77
76
} ;
78
77
79
78
let cx = LivenessContext {
@@ -222,7 +221,7 @@ impl<'a, 'typeck, 'b, 'tcx> LivenessResults<'a, 'typeck, 'b, 'tcx> {
222
221
// It may be necessary to just pick out the parts of
223
222
// `add_drop_live_facts_for()` that make sense.
224
223
let facts_to_add: Vec < _ > = {
225
- let drop_used = & self . cx . typeck . borrowck_context . all_facts . as_ref ( ) ?. var_dropped_at ;
224
+ let drop_used = & self . cx . typeck . all_facts . as_ref ( ) ?. var_dropped_at ;
226
225
227
226
let relevant_live_locals: FxIndexSet < _ > =
228
227
relevant_live_locals. iter ( ) . copied ( ) . collect ( ) ;
@@ -235,12 +234,7 @@ impl<'a, 'typeck, 'b, 'tcx> LivenessResults<'a, 'typeck, 'b, 'tcx> {
235
234
return None ;
236
235
}
237
236
238
- let location = match self
239
- . cx
240
- . typeck
241
- . borrowck_context
242
- . location_table
243
- . to_location ( * location_index)
237
+ let location = match self . cx . typeck . location_table . to_location ( * location_index)
244
238
{
245
239
RichLocation :: Start ( l) => l,
246
240
RichLocation :: Mid ( l) => l,
@@ -616,13 +610,9 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
616
610
tcx : typeck. tcx ( ) ,
617
611
param_env : typeck. param_env ,
618
612
op : |r| {
619
- let live_region_vid = typeck. borrowck_context . universal_regions . to_region_vid ( r) ;
613
+ let live_region_vid = typeck. universal_regions . to_region_vid ( r) ;
620
614
621
- typeck
622
- . borrowck_context
623
- . constraints
624
- . liveness_constraints
625
- . add_points ( live_region_vid, live_at) ;
615
+ typeck. constraints . liveness_constraints . add_points ( live_region_vid, live_at) ;
626
616
} ,
627
617
} ) ;
628
618
}
0 commit comments