1
Fork 0

Make async fn in traits work

This commit is contained in:
Michael Goulet 2022-09-02 15:57:31 +00:00
parent ed2a32f22c
commit 5be30f9d79
10 changed files with 46 additions and 41 deletions

View file

@ -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,