diff --git a/src/closures.rs b/src/closures.rs index eaa42b991f2..ed5c577d933 100644 --- a/src/closures.rs +++ b/src/closures.rs @@ -170,6 +170,7 @@ fn rewrite_closure_expr( fn allow_multi_line(expr: &ast::Expr) -> bool { match expr.kind { ast::ExprKind::Match(..) + | ast::ExprKind::Async(..) | ast::ExprKind::Block(..) | ast::ExprKind::TryBlock(..) | ast::ExprKind::Loop(..) diff --git a/tests/target/async_closure.rs b/tests/target/async_closure.rs index db6405482c5..9364e7dcc67 100644 --- a/tests/target/async_closure.rs +++ b/tests/target/async_closure.rs @@ -15,4 +15,8 @@ fn main() { let x = 3; x }; + + let f = |x| async { + println!("hello, world"); + }; }