diff options
| author | bors <bors@rust-lang.org> | 2025-03-30 21:59:02 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-30 21:59:02 +0000 | 
| commit | 2ea33b591050c4ca1a3752830b29112638faecf6 (patch) | |
| tree | 06a7036e609ed309df1d7f2dd252065470ffdcc3 /compiler/rustc_lint/src/lib.rs | |
| parent | fedf10752b973d83f3f7c0f819b2659c21a634de (diff) | |
| parent | cc5ee70b1a51bf30e85d261cc6e485eb3431bcac (diff) | |
| download | rust-2ea33b591050c4ca1a3752830b29112638faecf6.tar.gz rust-2ea33b591050c4ca1a3752830b29112638faecf6.zip  | |
Auto merge of #139131 - m-ou-se:format-args-struct-expr, r=Mark-Simulacrum
Simplify expansion for format_args!().
Instead of calling `Placeholder::new()`, we can just use a struct expression directly.
Before:
```rust
        Placeholder::new(…, …, …, …)
```
After:
```rust
        Placeholder {
                position: …,
                flags: …,
                width: …,
                precision: …,
        }
```
(I originally avoided the struct expression, because `Placeholder` had a lot of fields. But now that https://github.com/rust-lang/rust/pull/136974 is merged, it only has four fields left.)
This will make the `fmt` argument to `fmt::Arguments::new_v1_formatted()` a candidate for const promotion, which is important if we ever hope to tackle https://github.com/rust-lang/rust/issues/92698 (It doesn't change anything yet though, because the `args` argument to `fmt::Arguments::new_v1_formatted()` is not const-promotable.)
Diffstat (limited to 'compiler/rustc_lint/src/lib.rs')
0 files changed, 0 insertions, 0 deletions
