Skip to content

Commit 91d0b48

Browse files
committed
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 rust-lang/rust#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 rust-lang/rust#92698 (It doesn't change anything yet though, because the `args` argument to `fmt::Arguments::new_v1_formatted()` is not const-promotable.)
2 parents 6436058 + eb6d674 commit 91d0b48

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)