Make async fn in traits work
This commit is contained in:
parent
ed2a32f22c
commit
5be30f9d79
10 changed files with 46 additions and 41 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue