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