From 9c0d9babd1c72a25f350a4e3c1277394ae80353e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 26 Jul 2022 15:23:26 -0300 Subject: [PATCH] Do not execute captures code for async fns --- compiler/rustc_ast_lowering/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 340f88e7540e..6c0521da1ad4 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1877,7 +1877,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let context = ImplTraitContext::ReturnPositionOpaqueTy { origin: hir::OpaqueTyOrigin::FnReturn(fn_def_id), }; - self.lower_ty(ty, context, true) + self.lower_ty(ty, context, false) } FnRetTy::Default(ret_ty_span) => self.arena.alloc(self.ty_tup(*ret_ty_span, &[])), };