mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-28 11:38:01 +00:00
Pretty print async block without redundant space
**Repro:**
```rust
macro_rules! m {
($e:expr) => { stringify!($e) };
}
fn main() {
println!("{:?}", m!(async {}));
}
```
**Before:** <code>"async {}"</code>
**After:** `"async {}"`
<br>
In this function:
65c55bf931/compiler/rustc_ast_pretty/src/pprust/state.rs (L2049-L2051)
the `print_capture_clause` and `word_nbsp`/`word_space` calls already put a space after the `async` and `move` keywords being printed. The extra `self.s.space()` call removed by this PR resulted in the redundant double space.
65c55bf931/compiler/rustc_ast_pretty/src/pprust/state.rs (L2640-L2645)
65c55bf931/compiler/rustc_ast_pretty/src/helpers.rs (L34-L37)
65c55bf931/compiler/rustc_ast_pretty/src/helpers.rs (L5-L8)