diff options
| author | Michael Goulet <michael@errs.io> | 2022-09-02 15:57:31 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-09-09 01:31:45 +0000 |
| commit | 5be30f9d79b2e08128704ddb29f7925e2fb3ef88 (patch) | |
| tree | 569598861d0545c9bd19c1e3aafca6b374d276f0 /compiler/rustc_ast_lowering/src/expr.rs | |
| parent | ed2a32f22cfb7e43a3d8c732ac8fa8007c061c5f (diff) | |
| download | rust-5be30f9d79b2e08128704ddb29f7925e2fb3ef88.tar.gz rust-5be30f9d79b2e08128704ddb29f7925e2fb3ef88.zip | |
Make async fn in traits work
Diffstat (limited to 'compiler/rustc_ast_lowering/src/expr.rs')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/expr.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 5346f1ced82..f929549d704 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -851,7 +851,7 @@ impl<'hir> LoweringContext<'_, 'hir> { self.lower_lifetime_binder(closure_id, generic_params, |lctx, bound_generic_params| { // Lower outside new scope to preserve `is_in_loop_condition`. - let fn_decl = lctx.lower_fn_decl(decl, None, FnDeclKind::Closure, None); + let fn_decl = lctx.lower_fn_decl(decl, None, fn_decl_span, FnDeclKind::Closure, None); let c = lctx.arena.alloc(hir::Closure { binder: binder_clause, @@ -955,7 +955,8 @@ impl<'hir> LoweringContext<'_, 'hir> { // We need to lower the declaration outside the new scope, because we // have to conserve the state of being inside a loop condition for the // closure argument types. - let fn_decl = lctx.lower_fn_decl(&outer_decl, None, FnDeclKind::Closure, None); + let fn_decl = + lctx.lower_fn_decl(&outer_decl, None, fn_decl_span, FnDeclKind::Closure, None); let c = lctx.arena.alloc(hir::Closure { binder: binder_clause, |
