@@ -262,6 +262,9 @@ struct PoloniusOutOfScopePrecomputer<'a, 'tcx> {
262
262
263
263
impl < ' a , ' tcx > PoloniusOutOfScopePrecomputer < ' a , ' tcx > {
264
264
fn new ( body : & ' a Body < ' tcx > , regioncx : & ' a RegionInferenceContext < ' tcx > ) -> Self {
265
+ let sccs = regioncx. constraint_sccs ( ) ;
266
+ let num_sccs = sccs. num_sccs ( ) ;
267
+
265
268
// Compute the list of SCCs that are live at all points, as it will be used for all the
266
269
// loan scopes we'll compute.
267
270
// FIXME: they're surely already available somewhere.
@@ -279,13 +282,12 @@ impl<'a, 'tcx> PoloniusOutOfScopePrecomputer<'a, 'tcx> {
279
282
) ;
280
283
live_at_all_points
281
284
} )
282
- . map ( |r| regioncx . constraint_sccs . scc ( r) )
285
+ . map ( |r| sccs . scc ( r) )
283
286
. collect ( ) ;
284
287
285
288
// Pre-compute the set of live SCCs per point
286
289
let liveness = & regioncx. liveness_constraints ;
287
- let sccs = & regioncx. constraint_sccs ;
288
- let mut live_sccs_per_point = SparseBitMatrix :: new ( sccs. num_sccs ( ) ) ;
290
+ let mut live_sccs_per_point = SparseBitMatrix :: new ( num_sccs) ;
289
291
290
292
for region in liveness. rows ( ) {
291
293
let scc = sccs. scc ( region) ;
@@ -306,7 +308,7 @@ impl<'a, 'tcx> PoloniusOutOfScopePrecomputer<'a, 'tcx> {
306
308
loans_out_of_scope_at_location : FxIndexMap :: default ( ) ,
307
309
sccs_live_at_all_points,
308
310
live_sccs_per_point,
309
- reachability : BitSet :: new_empty ( regioncx . constraint_sccs . num_sccs ( ) ) ,
311
+ reachability : BitSet :: new_empty ( num_sccs) ,
310
312
reachability_stack : vec ! [ ] ,
311
313
}
312
314
}
@@ -327,7 +329,7 @@ impl<'tcx> PoloniusOutOfScopePrecomputer<'_, 'tcx> {
327
329
// regions via member constraints. (The `OutOfScopePrecomputer` wouldn't be called on a
328
330
// region that outlives free regions via outlives constraints.)
329
331
330
- let sccs = & self . regioncx . constraint_sccs ;
332
+ let sccs = self . regioncx . constraint_sccs ( ) ;
331
333
let member_constraints = & self . regioncx . member_constraints ;
332
334
333
335
let issuing_region_scc = sccs. scc ( issuing_region) ;
0 commit comments