This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree 1 file changed +5
-6
lines changed
compiler/rustc_borrowck/src/region_infer 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: constraints:: ConstraintSccIndex ;
2
2
use crate :: RegionInferenceContext ;
3
- use itertools:: Itertools ;
4
3
use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
5
4
use rustc_data_structures:: graph:: vec_graph:: VecGraph ;
6
5
use rustc_data_structures:: graph:: WithSuccessors ;
@@ -48,16 +47,16 @@ impl RegionInferenceContext<'_> {
48
47
. universal_regions
49
48
. universal_regions ( )
50
49
. map ( |region| ( self . constraint_sccs . scc ( region) , region) )
51
- . collect_vec ( ) ;
50
+ . collect :: < Vec < _ > > ( ) ;
52
51
paired_scc_regions. sort ( ) ;
53
52
let universal_regions = paired_scc_regions. iter ( ) . map ( |& ( _, region) | region) . collect ( ) ;
54
53
55
54
let mut scc_regions = FxIndexMap :: default ( ) ;
56
55
let mut start = 0 ;
57
- for ( scc , group ) in & paired_scc_regions. into_iter ( ) . group_by ( | ( scc , _) | * scc ) {
58
- let group_size = group . count ( ) ;
59
- scc_regions. insert ( scc, start..start + group_size ) ;
60
- start += group_size ;
56
+ for chunk in paired_scc_regions. chunk_by ( | & ( scc1 , _) , & ( scc2 , _ ) | scc1 == scc2 ) {
57
+ let ( scc , _ ) = chunk [ 0 ] ;
58
+ scc_regions. insert ( scc, start..start + chunk . len ( ) ) ;
59
+ start += chunk . len ( ) ;
61
60
}
62
61
63
62
self . rev_scc_graph = Some ( ReverseSccGraph { graph, scc_regions, universal_regions } ) ;
You can’t perform that action at this time.
0 commit comments