Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions src/test/pretty/async.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// pp-exact
// pretty-compare-only
// edition:2021

async fn f() {
let first = async { 1 };
let second = async move { 2 };
join(first, second).await
}
2 changes: 1 addition & 1 deletion src/test/ui/async-await/issues/issue-54752-async-block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
// edition:2018
// pp-exact

fn main() { let _a = (async { }); }
fn main() { let _a = (async { }); }
//~^ WARNING unnecessary parentheses around assigned value
8 changes: 4 additions & 4 deletions src/test/ui/async-await/issues/issue-54752-async-block.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down