@@ -206,19 +206,25 @@ impl<'hir> LoweringContext<'_, 'hir> {
206206 // `impl Future<Output = T>` here because lower_body
207207 // only cares about the input argument patterns in the function
208208 // declaration (decl), not the return types.
209- let coro_kind = header. coro_kind ;
209+ let coroutine_kind = header. coroutine_kind ;
210210 let body_id = this. lower_maybe_coroutine_body (
211211 span,
212212 hir_id,
213213 decl,
214- coro_kind ,
214+ coroutine_kind ,
215215 body. as_deref ( ) ,
216216 ) ;
217217
218218 let itctx = ImplTraitContext :: Universal ;
219219 let ( generics, decl) =
220220 this. lower_generics ( generics, header. constness , id, & itctx, |this| {
221- this. lower_fn_decl ( decl, id, * fn_sig_span, FnDeclKind :: Fn , coro_kind)
221+ this. lower_fn_decl (
222+ decl,
223+ id,
224+ * fn_sig_span,
225+ FnDeclKind :: Fn ,
226+ coroutine_kind,
227+ )
222228 } ) ;
223229 let sig = hir:: FnSig {
224230 decl,
@@ -734,7 +740,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
734740 sig,
735741 i. id ,
736742 FnDeclKind :: Trait ,
737- sig. header . coro_kind ,
743+ sig. header . coroutine_kind ,
738744 ) ;
739745 ( generics, hir:: TraitItemKind :: Fn ( sig, hir:: TraitFn :: Required ( names) ) , false )
740746 }
@@ -743,15 +749,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
743749 i. span ,
744750 hir_id,
745751 & sig. decl ,
746- sig. header . coro_kind ,
752+ sig. header . coroutine_kind ,
747753 Some ( body) ,
748754 ) ;
749755 let ( generics, sig) = self . lower_method_sig (
750756 generics,
751757 sig,
752758 i. id ,
753759 FnDeclKind :: Trait ,
754- sig. header . coro_kind ,
760+ sig. header . coroutine_kind ,
755761 ) ;
756762 ( generics, hir:: TraitItemKind :: Fn ( sig, hir:: TraitFn :: Provided ( body_id) ) , true )
757763 }
@@ -844,15 +850,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
844850 i. span ,
845851 hir_id,
846852 & sig. decl ,
847- sig. header . coro_kind ,
853+ sig. header . coroutine_kind ,
848854 body. as_deref ( ) ,
849855 ) ;
850856 let ( generics, sig) = self . lower_method_sig (
851857 generics,
852858 sig,
853859 i. id ,
854860 if self . is_in_trait_impl { FnDeclKind :: Impl } else { FnDeclKind :: Inherent } ,
855- sig. header . coro_kind ,
861+ sig. header . coroutine_kind ,
856862 ) ;
857863
858864 ( generics, hir:: ImplItemKind :: Fn ( sig, body_id) )
@@ -1023,13 +1029,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
10231029 span : Span ,
10241030 fn_id : hir:: HirId ,
10251031 decl : & FnDecl ,
1026- coro_kind : Option < CoroutineKind > ,
1032+ coroutine_kind : Option < CoroutineKind > ,
10271033 body : Option < & Block > ,
10281034 ) -> hir:: BodyId {
1029- let ( Some ( coro_kind ) , Some ( body) ) = ( coro_kind , body) else {
1035+ let ( Some ( coroutine_kind ) , Some ( body) ) = ( coroutine_kind , body) else {
10301036 return self . lower_fn_body_block ( span, decl, body) ;
10311037 } ;
1032- let closure_id = match coro_kind {
1038+ let closure_id = match coroutine_kind {
10331039 CoroutineKind :: Async { closure_id, .. } | CoroutineKind :: Gen { closure_id, .. } => {
10341040 closure_id
10351041 }
@@ -1200,7 +1206,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
12001206
12011207 this. expr_block ( body)
12021208 } ;
1203- let coroutine_expr = match coro_kind {
1209+ // FIXME(gen_blocks): Consider unifying the `make_*_expr` functions.
1210+ let coroutine_expr = match coroutine_kind {
12041211 CoroutineKind :: Async { .. } => this. make_async_expr (
12051212 CaptureBy :: Value { move_kw : rustc_span:: DUMMY_SP } ,
12061213 closure_id,
@@ -1233,19 +1240,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
12331240 sig : & FnSig ,
12341241 id : NodeId ,
12351242 kind : FnDeclKind ,
1236- coro_kind : Option < CoroutineKind > ,
1243+ coroutine_kind : Option < CoroutineKind > ,
12371244 ) -> ( & ' hir hir:: Generics < ' hir > , hir:: FnSig < ' hir > ) {
12381245 let header = self . lower_fn_header ( sig. header ) ;
12391246 let itctx = ImplTraitContext :: Universal ;
12401247 let ( generics, decl) =
12411248 self . lower_generics ( generics, sig. header . constness , id, & itctx, |this| {
1242- this. lower_fn_decl ( & sig. decl , id, sig. span , kind, coro_kind )
1249+ this. lower_fn_decl ( & sig. decl , id, sig. span , kind, coroutine_kind )
12431250 } ) ;
12441251 ( generics, hir:: FnSig { header, decl, span : self . lower_span ( sig. span ) } )
12451252 }
12461253
12471254 fn lower_fn_header ( & mut self , h : FnHeader ) -> hir:: FnHeader {
1248- let asyncness = if let Some ( CoroutineKind :: Async { span, .. } ) = h. coro_kind {
1255+ let asyncness = if let Some ( CoroutineKind :: Async { span, .. } ) = h. coroutine_kind {
12491256 hir:: IsAsync :: Async ( span)
12501257 } else {
12511258 hir:: IsAsync :: NotAsync
0 commit comments