@@ -4424,35 +4424,6 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
4424
4424
ExprKind :: Type ( ref _type_expr, ref _ty) => {
4425
4425
visit:: walk_expr ( self , expr) ;
4426
4426
}
4427
- // `async |x| ...` gets desugared to `|x| async {...}`, so we need to
4428
- // resolve the arguments within the proper scopes so that usages of them inside the
4429
- // closure are detected as upvars rather than normal closure arg usages.
4430
- //
4431
- // Similarly, `gen |x| ...` gets desugared to `|x| gen {...}`, so we handle that too.
4432
- ExprKind :: Closure ( box ast:: Closure {
4433
- coroutine_kind : Some ( _) ,
4434
- ref fn_decl,
4435
- ref body,
4436
- ..
4437
- } ) => {
4438
- self . with_rib ( ValueNS , RibKind :: Normal , |this| {
4439
- this. with_label_rib ( RibKind :: FnOrCoroutine , |this| {
4440
- // Resolve arguments:
4441
- this. resolve_params ( & fn_decl. inputs ) ;
4442
- // No need to resolve return type --
4443
- // the outer closure return type is `FnRetTy::Default`.
4444
-
4445
- // Now resolve the inner closure
4446
- {
4447
- // No need to resolve arguments: the inner closure has none.
4448
- // Resolve the return type:
4449
- visit:: walk_fn_ret_ty ( this, & fn_decl. output ) ;
4450
- // Resolve the body
4451
- this. visit_expr ( body) ;
4452
- }
4453
- } )
4454
- } ) ;
4455
- }
4456
4427
// For closures, RibKind::FnOrCoroutine is added in visit_fn
4457
4428
ExprKind :: Closure ( box ast:: Closure {
4458
4429
binder : ClosureBinder :: For { ref generic_params, span } ,
0 commit comments