@@ -703,7 +703,8 @@ impl ExprCollector<'_> {
703
703
let Some ( try_from_output) = LangItem :: TryTraitFromOutput . path ( self . db , self . krate ) else {
704
704
return self . collect_block ( e) ;
705
705
} ;
706
- let label = self . alloc_label_desugared ( Label { name : Name :: generate_new_name ( ) } ) ;
706
+ let label = self
707
+ . alloc_label_desugared ( Label { name : Name :: generate_new_name ( self . body . labels . len ( ) ) } ) ;
707
708
let old_label = self . current_try_block_label . replace ( label) ;
708
709
709
710
let ( btail, expr_id) = self . with_labeled_rib ( label, |this| {
@@ -840,7 +841,7 @@ impl ExprCollector<'_> {
840
841
this. collect_expr_opt ( e. loop_body ( ) . map ( |it| it. into ( ) ) )
841
842
} ) ,
842
843
} ;
843
- let iter_name = Name :: generate_new_name ( ) ;
844
+ let iter_name = Name :: generate_new_name ( self . body . exprs . len ( ) ) ;
844
845
let iter_expr = self . alloc_expr ( Expr :: Path ( Path :: from ( iter_name. clone ( ) ) ) , syntax_ptr) ;
845
846
let iter_expr_mut = self . alloc_expr (
846
847
Expr :: Ref { expr : iter_expr, rawness : Rawness :: Ref , mutability : Mutability :: Mut } ,
@@ -901,7 +902,7 @@ impl ExprCollector<'_> {
901
902
Expr :: Call { callee : try_branch, args : Box :: new ( [ operand] ) , is_assignee_expr : false } ,
902
903
syntax_ptr,
903
904
) ;
904
- let continue_name = Name :: generate_new_name ( ) ;
905
+ let continue_name = Name :: generate_new_name ( self . body . bindings . len ( ) ) ;
905
906
let continue_binding =
906
907
self . alloc_binding ( continue_name. clone ( ) , BindingAnnotation :: Unannotated ) ;
907
908
let continue_bpat =
@@ -916,7 +917,7 @@ impl ExprCollector<'_> {
916
917
guard : None ,
917
918
expr : self . alloc_expr ( Expr :: Path ( Path :: from ( continue_name) ) , syntax_ptr) ,
918
919
} ;
919
- let break_name = Name :: generate_new_name ( ) ;
920
+ let break_name = Name :: generate_new_name ( self . body . bindings . len ( ) ) ;
920
921
let break_binding = self . alloc_binding ( break_name. clone ( ) , BindingAnnotation :: Unannotated ) ;
921
922
let break_bpat = self . alloc_pat_desugared ( Pat :: Bind { id : break_binding, subpat : None } ) ;
922
923
self . add_definition_to_binding ( break_binding, break_bpat) ;
0 commit comments