@@ -47,13 +47,12 @@ pub(super) fn trace<'a, 'tcx>(
4747
4848 // When using `-Zpolonius=next`, compute the set of loans that can reach a given region.
4949 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 ;
5251 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 ;
5453 let graph = outlives_constraints. graph ( typeck. infcx . num_region_vars ( ) ) ;
5554 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 ) ;
5756
5857 // Traverse each issuing region's constraints, and record the loan as flowing into the
5958 // outlived region.
@@ -73,7 +72,7 @@ pub(super) fn trace<'a, 'tcx>(
7372
7473 // Store the inflowing loans in the liveness constraints: they will be used to compute live
7574 // 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) ;
7776 } ;
7877
7978 let cx = LivenessContext {
@@ -222,7 +221,7 @@ impl<'a, 'typeck, 'b, 'tcx> LivenessResults<'a, 'typeck, 'b, 'tcx> {
222221 // It may be necessary to just pick out the parts of
223222 // `add_drop_live_facts_for()` that make sense.
224223 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 ;
226225
227226 let relevant_live_locals: FxIndexSet < _ > =
228227 relevant_live_locals. iter ( ) . copied ( ) . collect ( ) ;
@@ -235,12 +234,7 @@ impl<'a, 'typeck, 'b, 'tcx> LivenessResults<'a, 'typeck, 'b, 'tcx> {
235234 return None ;
236235 }
237236
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)
244238 {
245239 RichLocation :: Start ( l) => l,
246240 RichLocation :: Mid ( l) => l,
@@ -616,13 +610,9 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
616610 tcx : typeck. tcx ( ) ,
617611 param_env : typeck. param_env ,
618612 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) ;
620614
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) ;
626616 } ,
627617 } ) ;
628618 }
0 commit comments