diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-03-16 03:34:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-16 03:34:32 +0100 |
| commit | f986c7434ae958567721dfcff336c51cc2bf663d (patch) | |
| tree | b0ee5c1896c7e30952382d192c204c1d31622caa /compiler/rustc_codegen_llvm/src | |
| parent | f21488a12cf819947741e9e3549f7670ada9d26a (diff) | |
| parent | ac5c657a0801db84b29ea9b3ae322107756575b0 (diff) | |
| download | rust-f986c7434ae958567721dfcff336c51cc2bf663d.tar.gz rust-f986c7434ae958567721dfcff336c51cc2bf663d.zip | |
Rollup merge of #94868 - dtolnay:noblock, r=Dylan-DPC
Format core and std macro rules, removing needless surrounding blocks
Many of the asserting and printing macros in `core` and `std` are written with prehistoric-looking formatting, like this:
https://github.com/rust-lang/rust/blob/335ffbfa547df94ac236f5c56130cecf99c8d82b/library/std/src/macros.rs#L96-L101
In modern Rust style this would conventionally be written as follows instead, always using braces and a trailing semicolon on the macro arms:
https://github.com/rust-lang/rust/blob/af53809c874e0afb7be966df4d3cfcaa05277c53/library/std/src/macros.rs#L98-L105
Getting rid of the unneeded braces inside the expansion reduces extraneous indentation in macro-expanded code. For example:
```rust
println!("repro {}", true);
```
```rust
// before:
{
::std::io::_print(
::core::fmt::Arguments::new_v1(
&["repro ", "\n"],
&[::core::fmt::ArgumentV1::new_display(&true)],
),
);
};
```
```rust
// after:
::std::io::_print(
::core::fmt::Arguments::new_v1(
&["repro ", "\n"],
&[::core::fmt::ArgumentV1::new_display(&true)],
),
);
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
