@@ -181,17 +181,16 @@ struct BreakableScope<'tcx> {
181
181
182
182
#[ derive( Debug ) ]
183
183
struct ConstContinuableScope < ' tcx > {
184
- /// The if-then scope or arm scope .
184
+ /// The scope for the `#[loop_match]` which its `#[const_continue]`s will jump to .
185
185
region_scope : region:: Scope ,
186
- /// The destination of the loop/block expression itself (i.e., where to put
187
- /// the result of a `break` or `return` expression).
186
+ /// The place of the state of a `#[loop_match]`, which a `#[const_continue]` must update.
188
187
state_place : Place < ' tcx > ,
189
188
190
189
arms : Box < [ ArmId ] > ,
191
190
built_match_tree : BuiltMatchTree < ' tcx > ,
192
191
193
- /// Drops that happen on the `return` path and would have happened on the `break` path.
194
- break_drops : DropTree ,
192
+ /// Drops that happen on a `#[const_continue]`
193
+ const_continue_drops : DropTree ,
195
194
}
196
195
197
196
#[ derive( Debug ) ]
@@ -591,17 +590,21 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
591
590
let scope = ConstContinuableScope {
592
591
region_scope,
593
592
state_place,
594
- break_drops : DropTree :: new ( ) ,
593
+ const_continue_drops : DropTree :: new ( ) ,
595
594
arms,
596
595
built_match_tree,
597
596
} ;
598
597
self . scopes . const_continuable_scopes . push ( scope) ;
599
598
let normal_exit_block = f ( self ) ;
600
- let breakable_scope = self . scopes . const_continuable_scopes . pop ( ) . unwrap ( ) ;
601
- assert ! ( breakable_scope . region_scope == region_scope) ;
599
+ let const_continue_scope = self . scopes . const_continuable_scopes . pop ( ) . unwrap ( ) ;
600
+ assert ! ( const_continue_scope . region_scope == region_scope) ;
602
601
603
- let break_block =
604
- self . build_exit_tree ( breakable_scope. break_drops , region_scope, span, None ) ;
602
+ let break_block = self . build_exit_tree (
603
+ const_continue_scope. const_continue_drops ,
604
+ region_scope,
605
+ span,
606
+ None ,
607
+ ) ;
605
608
606
609
match ( normal_exit_block, break_block) {
607
610
( block, None ) => block,
@@ -892,7 +895,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
892
895
TerminatorKind :: FalseEdge { real_target : drop_and_continue_block, imaginary_target } ,
893
896
) ;
894
897
895
- let drops = & mut scope. break_drops ;
898
+ let drops = & mut scope. const_continue_drops ;
896
899
897
900
let drop_idx = self . scopes . scopes [ scope_index + 1 ..]
898
901
. iter ( )
0 commit comments