@@ -4331,10 +4331,11 @@ impl<'a> LoweringContext<'a> {
43314331 ThinVec :: new ( ) ,
43324332 ) )
43334333 } ;
4334- let match_stmt = respan (
4335- head_sp,
4336- hir:: StmtKind :: Expr ( match_expr, self . next_id ( ) . node_id )
4337- ) ;
4334+ let match_stmt = hir:: Stmt {
4335+ id : self . next_id ( ) . node_id ,
4336+ node : hir:: StmtKind :: Expr ( match_expr) ,
4337+ span : head_sp,
4338+ } ;
43384339
43394340 let next_expr = P ( self . expr_ident ( head_sp, next_ident, next_pat. id ) ) ;
43404341
@@ -4357,10 +4358,11 @@ impl<'a> LoweringContext<'a> {
43574358
43584359 let body_block = self . with_loop_scope ( e. id , |this| this. lower_block ( body, false ) ) ;
43594360 let body_expr = P ( self . expr_block ( body_block, ThinVec :: new ( ) ) ) ;
4360- let body_stmt = respan (
4361- body. span ,
4362- hir:: StmtKind :: Expr ( body_expr, self . next_id ( ) . node_id )
4363- ) ;
4361+ let body_stmt = hir:: Stmt {
4362+ id : self . next_id ( ) . node_id ,
4363+ node : hir:: StmtKind :: Expr ( body_expr) ,
4364+ span : body. span ,
4365+ } ;
43644366
43654367 let loop_block = P ( self . block_all (
43664368 e. span ,
@@ -4533,24 +4535,24 @@ impl<'a> LoweringContext<'a> {
45334535 let ( l, item_ids) = self . lower_local( l) ;
45344536 let mut ids: SmallVec <[ hir:: Stmt ; 1 ] > = item_ids
45354537 . into_iter( )
4536- . map( |item_id| Spanned {
4538+ . map( |item_id| hir:: Stmt {
4539+ id: self . next_id( ) . node_id,
45374540 node: hir:: StmtKind :: Decl (
45384541 P ( Spanned {
45394542 node: hir:: DeclKind :: Item ( item_id) ,
45404543 span: s. span,
45414544 } ) ,
4542- self . next_id( ) . node_id,
45434545 ) ,
45444546 span: s. span,
45454547 } )
45464548 . collect( ) ;
4547- ids. push( Spanned {
4549+ ids. push( hir:: Stmt {
4550+ id: self . lower_node_id( s. id) . node_id,
45484551 node: hir:: StmtKind :: Decl (
45494552 P ( Spanned {
45504553 node: hir:: DeclKind :: Local ( l) ,
45514554 span: s. span,
45524555 } ) ,
4553- self . lower_node_id( s. id) . node_id,
45544556 ) ,
45554557 span: s. span,
45564558 } ) ;
@@ -4561,26 +4563,28 @@ impl<'a> LoweringContext<'a> {
45614563 let mut id = Some ( s. id) ;
45624564 return self . lower_item_id( it)
45634565 . into_iter( )
4564- . map( |item_id| Spanned {
4566+ . map( |item_id| hir:: Stmt {
4567+ id: id. take( )
4568+ . map( |id| self . lower_node_id( id) . node_id)
4569+ . unwrap_or_else( || self . next_id( ) . node_id) ,
45654570 node: hir:: StmtKind :: Decl (
45664571 P ( Spanned {
45674572 node: hir:: DeclKind :: Item ( item_id) ,
45684573 span: s. span,
45694574 } ) ,
4570- id. take( )
4571- . map( |id| self . lower_node_id( id) . node_id)
4572- . unwrap_or_else( || self . next_id( ) . node_id) ,
45734575 ) ,
45744576 span: s. span,
45754577 } )
45764578 . collect( ) ;
45774579 }
4578- StmtKind :: Expr ( ref e) => Spanned {
4579- node: hir:: StmtKind :: Expr ( P ( self . lower_expr( e) ) , self . lower_node_id( s. id) . node_id) ,
4580+ StmtKind :: Expr ( ref e) => hir:: Stmt {
4581+ id: self . lower_node_id( s. id) . node_id,
4582+ node: hir:: StmtKind :: Expr ( P ( self . lower_expr( e) ) ) ,
45804583 span: s. span,
45814584 } ,
4582- StmtKind :: Semi ( ref e) => Spanned {
4583- node: hir:: StmtKind :: Semi ( P ( self . lower_expr( e) ) , self . lower_node_id( s. id) . node_id) ,
4585+ StmtKind :: Semi ( ref e) => hir:: Stmt {
4586+ id: self . lower_node_id( s. id) . node_id,
4587+ node: hir:: StmtKind :: Semi ( P ( self . lower_expr( e) ) ) ,
45844588 span: s. span,
45854589 } ,
45864590 StmtKind :: Mac ( ..) => panic!( "Shouldn't exist here" ) ,
@@ -4806,7 +4810,11 @@ impl<'a> LoweringContext<'a> {
48064810 source,
48074811 } ) ;
48084812 let decl = respan ( sp, hir:: DeclKind :: Local ( local) ) ;
4809- respan ( sp, hir:: StmtKind :: Decl ( P ( decl) , self . next_id ( ) . node_id ) )
4813+ hir:: Stmt {
4814+ id : self . next_id ( ) . node_id ,
4815+ node : hir:: StmtKind :: Decl ( P ( decl) ) ,
4816+ span : sp
4817+ }
48104818 }
48114819
48124820 fn stmt_let (
0 commit comments