mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
Fix formatting of async blocks
This commit is contained in:
parent
393d7217ae
commit
1fa06ecf1e
@ -1357,7 +1357,7 @@ pub fn can_be_overflowed_expr(
|
||||
}
|
||||
|
||||
// Handle always block-like expressions
|
||||
ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => true,
|
||||
ast::ExprKind::Async(..) | ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => true,
|
||||
|
||||
// Handle `[]` and `{}`-like expressions
|
||||
ast::ExprKind::Array(..) | ast::ExprKind::Struct(..) => {
|
||||
|
@ -16,4 +16,20 @@ fn baz() {
|
||||
let y = async {
|
||||
Ok(())
|
||||
}; // comment
|
||||
|
||||
spawn(
|
||||
a,
|
||||
async move {
|
||||
action();
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
|
||||
spawn(
|
||||
a,
|
||||
async move || {
|
||||
action();
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -12,4 +12,14 @@ fn baz() {
|
||||
};
|
||||
|
||||
let y = async { Ok(()) }; // comment
|
||||
|
||||
spawn(a, async move {
|
||||
action();
|
||||
Ok(())
|
||||
});
|
||||
|
||||
spawn(a, async move || {
|
||||
action();
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user