File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -717,9 +717,16 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
717
717
self . cx. parent
718
718
) ;
719
719
720
+ // Save all state that is specific to the outer function
721
+ // body. These will be restored once down below, once we've
722
+ // visited the body.
720
723
let outer_ec = mem:: replace ( & mut self . expr_and_pat_count , 0 ) ;
721
724
let outer_cx = self . cx ;
722
725
let outer_ts = mem:: take ( & mut self . terminating_scopes ) ;
726
+ // The 'pessimistic yield' flag is set to true when we are
727
+ // processing a `+=` statement and have to make pessimistic
728
+ // control flow assumptions. This doesn't apply to nested
729
+ // bodies within the `+=` statements. See #69307.
723
730
let outer_pessimistic_yield = mem:: replace ( & mut self . pessimistic_yield , false ) ;
724
731
self . terminating_scopes . insert ( body. value . hir_id . local_id ) ;
725
732
You can’t perform that action at this time.
0 commit comments