about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/tests.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-07 11:05:06 +0100
committerGitHub <noreply@github.com>2021-12-07 11:05:06 +0100
commitb2dcfddb24df78ec660b498ddf780550ba052119 (patch)
tree68734e75c6c9c691b0aee3a678eac6a9bc7899f8 /compiler/rustc_mir_transform/src/coverage/tests.rs
parent1c2fba65406e1d901194ec4c2c3162ba10e45f5b (diff)
parent33c29a3ad36621bf812fd8af0adceb16188f3624 (diff)
downloadrust-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&nbsp;&nbsp;{}"</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