@@ -577,7 +577,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
577
577
} ;
578
578
579
579
// The closure/generator `FnDecl` takes a single (resume) argument of type `input_ty`.
580
- let decl = self . arena . alloc ( hir:: FnDecl {
580
+ let fn_decl = self . arena . alloc ( hir:: FnDecl {
581
581
inputs : arena_vec ! [ self ; input_ty] ,
582
582
output,
583
583
c_variadic : false ,
@@ -598,7 +598,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
598
598
} ;
599
599
let params = arena_vec ! [ self ; param] ;
600
600
601
- let body_id = self . lower_body ( move |this| {
601
+ let body = self . lower_body ( move |this| {
602
602
this. generator_kind = Some ( hir:: GeneratorKind :: Async ( async_gen_kind) ) ;
603
603
604
604
let old_ctx = this. task_context ;
@@ -609,13 +609,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
609
609
} ) ;
610
610
611
611
// `static |_task_context| -> <ret_ty> { body }`:
612
- let generator_kind = hir:: ExprKind :: Closure (
612
+ let generator_kind = hir:: ExprKind :: Closure {
613
613
capture_clause,
614
- decl ,
615
- body_id ,
616
- self . lower_span ( span) ,
617
- Some ( hir:: Movability :: Static ) ,
618
- ) ;
614
+ fn_decl ,
615
+ body ,
616
+ fn_decl_span : self . lower_span ( span) ,
617
+ movability : Some ( hir:: Movability :: Static ) ,
618
+ } ;
619
619
let generator = hir:: Expr {
620
620
hir_id : self . lower_node_id ( closure_node_id) ,
621
621
kind : generator_kind,
@@ -840,7 +840,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
840
840
body : & Expr ,
841
841
fn_decl_span : Span ,
842
842
) -> hir:: ExprKind < ' hir > {
843
- let ( body_id , generator_option) = self . with_new_scopes ( move |this| {
843
+ let ( body , generator_option) = self . with_new_scopes ( move |this| {
844
844
let prev = this. current_item ;
845
845
this. current_item = Some ( fn_decl_span) ;
846
846
let mut generator_kind = None ;
@@ -858,13 +858,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
858
858
// Lower outside new scope to preserve `is_in_loop_condition`.
859
859
let fn_decl = self . lower_fn_decl ( decl, None , FnDeclKind :: Closure , None ) ;
860
860
861
- hir:: ExprKind :: Closure (
861
+ hir:: ExprKind :: Closure {
862
862
capture_clause,
863
863
fn_decl,
864
- body_id ,
865
- self . lower_span ( fn_decl_span) ,
866
- generator_option,
867
- )
864
+ body ,
865
+ fn_decl_span : self . lower_span ( fn_decl_span) ,
866
+ movability : generator_option,
867
+ }
868
868
}
869
869
870
870
fn generator_movability_for_fn (
@@ -911,7 +911,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
911
911
let outer_decl =
912
912
FnDecl { inputs : decl. inputs . clone ( ) , output : FnRetTy :: Default ( fn_decl_span) } ;
913
913
914
- let body_id = self . with_new_scopes ( |this| {
914
+ let body = self . with_new_scopes ( |this| {
915
915
// FIXME(cramertj): allow `async` non-`move` closures with arguments.
916
916
if capture_clause == CaptureBy :: Ref && !decl. inputs . is_empty ( ) {
917
917
struct_span_err ! (
@@ -950,13 +950,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
950
950
// closure argument types.
951
951
let fn_decl = self . lower_fn_decl ( & outer_decl, None , FnDeclKind :: Closure , None ) ;
952
952
953
- hir:: ExprKind :: Closure (
953
+ hir:: ExprKind :: Closure {
954
954
capture_clause,
955
955
fn_decl,
956
- body_id ,
957
- self . lower_span ( fn_decl_span) ,
958
- None ,
959
- )
956
+ body ,
957
+ fn_decl_span : self . lower_span ( fn_decl_span) ,
958
+ movability : None ,
959
+ }
960
960
}
961
961
962
962
/// Destructure the LHS of complex assignments.
0 commit comments