File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed
src/librustc_mir/borrow_check/nll/region_infer Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -471,35 +471,31 @@ impl<'tcx> RegionInferenceContext<'tcx> {
471
471
changed |= new;
472
472
473
473
let block_data = & mir[ p. block ] ;
474
- let successor_points = if p. statement_index < block_data. statements . len ( ) {
475
- vec ! [
476
- Location {
477
- statement_index: p. statement_index + 1 ,
478
- ..p
479
- } ,
480
- ]
474
+
475
+ let start_stack_len = stack. len ( ) ;
476
+
477
+ if p. statement_index < block_data. statements . len ( ) {
478
+ stack. push ( Location {
479
+ statement_index : p. statement_index + 1 ,
480
+ ..p
481
+ } ) ;
481
482
} else {
482
- block_data
483
- . terminator ( )
484
- . successors ( )
485
- . iter ( )
486
- . map ( |& basic_block| {
483
+ stack. extend ( block_data. terminator ( ) . successors ( ) . iter ( ) . map (
484
+ |& basic_block| {
487
485
Location {
488
486
statement_index : 0 ,
489
487
block : basic_block,
490
488
}
491
- } )
492
- . collect :: < Vec < _ > > ( )
493
- } ;
489
+ } ,
490
+ ) ) ;
491
+ }
494
492
495
- if successor_points . is_empty ( ) {
493
+ if stack . len ( ) == start_stack_len {
496
494
// If we reach the END point in the graph, then copy
497
495
// over any skolemized end points in the `from_region`
498
496
// and make sure they are included in the `to_region`.
499
497
changed |=
500
498
inferred_values. add_universal_regions_outlived_by ( from_region, to_region) ;
501
- } else {
502
- stack. extend ( successor_points) ;
503
499
}
504
500
}
505
501
You can’t perform that action at this time.
0 commit comments