diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-05 15:04:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-05 15:04:20 +0100 |
| commit | a8f8f746fc046a025d1b8c464ce28f6b828f32e9 (patch) | |
| tree | 162c91c875293c2c5b332f5fca640ea38c515956 /compiler/rustc_codegen_gcc | |
| parent | 214b2a126bc6654bf60108aea2e8dce94b096b4b (diff) | |
| parent | b516a8c5cbcde670e509182592547072a723875a (diff) | |
| download | rust-a8f8f746fc046a025d1b8c464ce28f6b828f32e9.tar.gz rust-a8f8f746fc046a025d1b8c464ce28f6b828f32e9.zip | |
Rollup merge of #91437 - dtolnay:emptybrace, r=nagisa
Pretty print empty blocks as {}
**Example:**
```rust
macro_rules! p {
($e:expr) => {
println!("{}", stringify!($e));
};
($i:item) => {
println!("{}", stringify!($i));
};
}
fn main() {
p!(if true {});
p!(struct S {});
}
```
**Before:**
```console
if true { }
struct S {
}
```
**After:**
```console
if true {}
struct S {}
```
This affects [`dbg!`](https://doc.rust-lang.org/std/macro.dbg.html), as well as ecosystem uses of stringify such as in [`anyhow::ensure!`](https://docs.rs/anyhow/1/anyhow/macro.ensure.html). Printing a `{ }` in today's heavily rustfmt'd world comes out looking jarring/sloppy.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions
