1
Fork 0

Pretty print async block without redundant space

This commit is contained in:
David Tolnay 2021-12-05 10:53:21 -08:00
parent a9f14c18fa
commit 33c29a3ad3
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
3 changed files with 5 additions and 6 deletions

View file

@ -2068,7 +2068,6 @@ impl<'a> State<'a> {
ast::ExprKind::Async(capture_clause, _, ref blk) => {
self.word_nbsp("async");
self.print_capture_clause(capture_clause);
self.s.space();
// cbox/ibox in analogy to the `ExprKind::Block` arm above
self.cbox(INDENT_UNIT);
self.ibox(0);

View file

@ -3,5 +3,5 @@
// edition:2018
// pp-exact
fn main() { let _a = (async { }); }
fn main() { let _a = (async { }); }
//~^ WARNING unnecessary parentheses around assigned value

View file

@ -1,14 +1,14 @@
warning: unnecessary parentheses around assigned value
--> $DIR/issue-54752-async-block.rs:6:22
|
LL | fn main() { let _a = (async { }); }
| ^ ^
LL | fn main() { let _a = (async { }); }
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
LL - fn main() { let _a = (async { }); }
LL + fn main() { let _a = async { }; }
LL - fn main() { let _a = (async { }); }
LL + fn main() { let _a = async { }; }
|
warning: 1 warning emitted