diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-07 11:05:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-07 11:05:06 +0100 |
| commit | b2dcfddb24df78ec660b498ddf780550ba052119 (patch) | |
| tree | 68734e75c6c9c691b0aee3a678eac6a9bc7899f8 /compiler/rustc_mir_transform/src/coverage/tests.rs | |
| parent | 1c2fba65406e1d901194ec4c2c3162ba10e45f5b (diff) | |
| parent | 33c29a3ad36621bf812fd8af0adceb16188f3624 (diff) | |
| download | rust-b2dcfddb24df78ec660b498ddf780550ba052119.tar.gz rust-b2dcfddb24df78ec660b498ddf780550ba052119.zip | |
Rollup merge of #91562 - dtolnay:asyncspace, r=Mark-Simulacrum
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:
https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/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.
https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/pprust/state.rs#L2640-L2645
https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/helpers.rs#L34-L37
https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/helpers.rs#L5-L8
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/tests.rs')
0 files changed, 0 insertions, 0 deletions
