@@ -224,9 +224,22 @@ impl ExprCollector<'_> {
224224 self . alloc_expr ( Expr :: Unsafe { body } , syntax_ptr)
225225 }
226226 // FIXME: we need to record these effects somewhere...
227- ast:: Effect :: Async ( _) | ast:: Effect :: Label ( _) => {
228- self . collect_block_opt ( e. block_expr ( ) )
229- }
227+ ast:: Effect :: Label ( label) => match e. block_expr ( ) {
228+ Some ( block) => {
229+ let res = self . collect_block ( block) ;
230+ match & mut self . body . exprs [ res] {
231+ Expr :: Block { label : block_label, .. } => {
232+ * block_label =
233+ label. lifetime_token ( ) . map ( |t| Name :: new_lifetime ( & t) )
234+ }
235+ _ => unreachable ! ( ) ,
236+ }
237+ res
238+ }
239+ None => self . missing_expr ( ) ,
240+ } ,
241+ // FIXME: we need to record these effects somewhere...
242+ ast:: Effect :: Async ( _) => self . collect_block_opt ( e. block_expr ( ) ) ,
230243 } ,
231244 ast:: Expr :: BlockExpr ( e) => self . collect_block ( e) ,
232245 ast:: Expr :: LoopExpr ( e) => {
@@ -460,7 +473,7 @@ impl ExprCollector<'_> {
460473 self . alloc_expr ( Expr :: Missing , syntax_ptr)
461474 }
462475 }
463- ast:: Expr :: LambdaExpr ( e) => {
476+ ast:: Expr :: ClosureExpr ( e) => {
464477 let mut args = Vec :: new ( ) ;
465478 let mut arg_types = Vec :: new ( ) ;
466479 if let Some ( pl) = e. param_list ( ) {
@@ -618,8 +631,7 @@ impl ExprCollector<'_> {
618631 } )
619632 . collect ( ) ;
620633 let tail = block. expr ( ) . map ( |e| self . collect_expr ( e) ) ;
621- let label = block. label ( ) . and_then ( |l| l. lifetime_token ( ) ) . map ( |t| Name :: new_lifetime ( & t) ) ;
622- self . alloc_expr ( Expr :: Block { statements, tail, label } , syntax_node_ptr)
634+ self . alloc_expr ( Expr :: Block { statements, tail, label : None } , syntax_node_ptr)
623635 }
624636
625637 fn collect_block_items ( & mut self , block : & ast:: BlockExpr ) {
0 commit comments