File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
compiler/rustc_borrowck/src/region_infer Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11use crate :: constraints:: ConstraintSccIndex ;
22use crate :: RegionInferenceContext ;
3- use itertools:: Itertools ;
43use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
54use rustc_data_structures:: graph:: vec_graph:: VecGraph ;
65use rustc_data_structures:: graph:: WithSuccessors ;
@@ -48,16 +47,16 @@ impl RegionInferenceContext<'_> {
4847 . universal_regions
4948 . universal_regions ( )
5049 . map ( |region| ( self . constraint_sccs . scc ( region) , region) )
51- . collect_vec ( ) ;
50+ . collect :: < Vec < _ > > ( ) ;
5251 paired_scc_regions. sort ( ) ;
5352 let universal_regions = paired_scc_regions. iter ( ) . map ( |& ( _, region) | region) . collect ( ) ;
5453
5554 let mut scc_regions = FxIndexMap :: default ( ) ;
5655 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 ( ) ;
6160 }
6261
6362 self . rev_scc_graph = Some ( ReverseSccGraph { graph, scc_regions, universal_regions } ) ;
You can’t perform that action at this time.
0 commit comments