Do not execute captures code for async fns

This commit is contained in:
Santiago Pastorino 2022-07-26 15:23:26 -03:00
parent 5a184acfc6
commit 9c0d9babd1
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -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, &[])),
};