@@ -206,19 +206,25 @@ impl<'hir> LoweringContext<'_, 'hir> {
206
206
// `impl Future<Output = T>` here because lower_body
207
207
// only cares about the input argument patterns in the function
208
208
// declaration (decl), not the return types.
209
- let coro_kind = header. coro_kind ;
209
+ let coroutine_kind = header. coroutine_kind ;
210
210
let body_id = this. lower_maybe_coroutine_body (
211
211
span,
212
212
hir_id,
213
213
decl,
214
- coro_kind ,
214
+ coroutine_kind ,
215
215
body. as_deref ( ) ,
216
216
) ;
217
217
218
218
let itctx = ImplTraitContext :: Universal ;
219
219
let ( generics, decl) =
220
220
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
+ )
222
228
} ) ;
223
229
let sig = hir:: FnSig {
224
230
decl,
@@ -735,7 +741,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
735
741
sig,
736
742
i. id ,
737
743
FnDeclKind :: Trait ,
738
- sig. header . coro_kind ,
744
+ sig. header . coroutine_kind ,
739
745
) ;
740
746
( generics, hir:: TraitItemKind :: Fn ( sig, hir:: TraitFn :: Required ( names) ) , false )
741
747
}
@@ -744,15 +750,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
744
750
i. span ,
745
751
hir_id,
746
752
& sig. decl ,
747
- sig. header . coro_kind ,
753
+ sig. header . coroutine_kind ,
748
754
Some ( body) ,
749
755
) ;
750
756
let ( generics, sig) = self . lower_method_sig (
751
757
generics,
752
758
sig,
753
759
i. id ,
754
760
FnDeclKind :: Trait ,
755
- sig. header . coro_kind ,
761
+ sig. header . coroutine_kind ,
756
762
) ;
757
763
( generics, hir:: TraitItemKind :: Fn ( sig, hir:: TraitFn :: Provided ( body_id) ) , true )
758
764
}
@@ -845,15 +851,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
845
851
i. span ,
846
852
hir_id,
847
853
& sig. decl ,
848
- sig. header . coro_kind ,
854
+ sig. header . coroutine_kind ,
849
855
body. as_deref ( ) ,
850
856
) ;
851
857
let ( generics, sig) = self . lower_method_sig (
852
858
generics,
853
859
sig,
854
860
i. id ,
855
861
if self . is_in_trait_impl { FnDeclKind :: Impl } else { FnDeclKind :: Inherent } ,
856
- sig. header . coro_kind ,
862
+ sig. header . coroutine_kind ,
857
863
) ;
858
864
859
865
( generics, hir:: ImplItemKind :: Fn ( sig, body_id) )
@@ -1024,13 +1030,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
1024
1030
span : Span ,
1025
1031
fn_id : hir:: HirId ,
1026
1032
decl : & FnDecl ,
1027
- coro_kind : Option < CoroutineKind > ,
1033
+ coroutine_kind : Option < CoroutineKind > ,
1028
1034
body : Option < & Block > ,
1029
1035
) -> hir:: BodyId {
1030
- let ( Some ( coro_kind ) , Some ( body) ) = ( coro_kind , body) else {
1036
+ let ( Some ( coroutine_kind ) , Some ( body) ) = ( coroutine_kind , body) else {
1031
1037
return self . lower_fn_body_block ( span, decl, body) ;
1032
1038
} ;
1033
- let closure_id = match coro_kind {
1039
+ let closure_id = match coroutine_kind {
1034
1040
CoroutineKind :: Async { closure_id, .. } | CoroutineKind :: Gen { closure_id, .. } => {
1035
1041
closure_id
1036
1042
}
@@ -1201,7 +1207,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1201
1207
1202
1208
this. expr_block ( body)
1203
1209
} ;
1204
- let coroutine_expr = match coro_kind {
1210
+ let coroutine_expr = match coroutine_kind {
1205
1211
CoroutineKind :: Async { .. } => this. make_async_expr (
1206
1212
CaptureBy :: Value { move_kw : rustc_span:: DUMMY_SP } ,
1207
1213
closure_id,
@@ -1234,19 +1240,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
1234
1240
sig : & FnSig ,
1235
1241
id : NodeId ,
1236
1242
kind : FnDeclKind ,
1237
- coro_kind : Option < CoroutineKind > ,
1243
+ coroutine_kind : Option < CoroutineKind > ,
1238
1244
) -> ( & ' hir hir:: Generics < ' hir > , hir:: FnSig < ' hir > ) {
1239
1245
let header = self . lower_fn_header ( sig. header ) ;
1240
1246
let itctx = ImplTraitContext :: Universal ;
1241
1247
let ( generics, decl) =
1242
1248
self . lower_generics ( generics, sig. header . constness , id, & itctx, |this| {
1243
- 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 )
1244
1250
} ) ;
1245
1251
( generics, hir:: FnSig { header, decl, span : self . lower_span ( sig. span ) } )
1246
1252
}
1247
1253
1248
1254
fn lower_fn_header ( & mut self , h : FnHeader ) -> hir:: FnHeader {
1249
- let asyncness = if let Some ( CoroutineKind :: Async { span, .. } ) = h. coro_kind {
1255
+ let asyncness = if let Some ( CoroutineKind :: Async { span, .. } ) = h. coroutine_kind {
1250
1256
hir:: IsAsync :: Async ( span)
1251
1257
} else {
1252
1258
hir:: IsAsync :: NotAsync
0 commit comments