@@ -916,10 +916,10 @@ impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast,
916
916
& sig. decl . output ,
917
917
) ;
918
918
919
- if let Some ( ( async_node_id , _) ) =
919
+ if let Some ( ( coro_node_id , _) ) =
920
920
sig. header . coro_kind . map ( |coro_kind| coro_kind. return_id ( ) )
921
921
{
922
- this. record_lifetime_params_for_impl_trait ( async_node_id ) ;
922
+ this. record_lifetime_params_for_impl_trait ( coro_node_id ) ;
923
923
}
924
924
} ,
925
925
) ;
@@ -942,13 +942,13 @@ impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast,
942
942
this. visit_generics ( generics) ;
943
943
944
944
let declaration = & sig. decl ;
945
- let async_node_id =
945
+ let coro_node_id =
946
946
sig. header . coro_kind . map ( |coro_kind| coro_kind. return_id ( ) ) ;
947
947
948
948
this. with_lifetime_rib (
949
949
LifetimeRibKind :: AnonymousCreateParameter {
950
950
binder : fn_id,
951
- report_in_path : async_node_id . is_some ( ) ,
951
+ report_in_path : coro_node_id . is_some ( ) ,
952
952
} ,
953
953
|this| {
954
954
this. resolve_fn_signature (
@@ -961,7 +961,7 @@ impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast,
961
961
& declaration. output ,
962
962
) ;
963
963
964
- if let Some ( ( async_node_id, _) ) = async_node_id {
964
+ if let Some ( ( async_node_id, _) ) = coro_node_id {
965
965
this. record_lifetime_params_for_impl_trait ( async_node_id) ;
966
966
}
967
967
} ,
@@ -4291,8 +4291,10 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
4291
4291
// `async |x| ...` gets desugared to `|x| async {...}`, so we need to
4292
4292
// resolve the arguments within the proper scopes so that usages of them inside the
4293
4293
// closure are detected as upvars rather than normal closure arg usages.
4294
+ //
4295
+ // Similarly, `gen |x| ...` gets desugared to `|x| gen {...}`, so we handle that too.
4294
4296
ExprKind :: Closure ( box ast:: Closure {
4295
- coro_kind : Some ( CoroutineKind :: Async { .. } ) ,
4297
+ coro_kind : Some ( _ ) ,
4296
4298
ref fn_decl,
4297
4299
ref body,
4298
4300
..
0 commit comments