Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, r=fee1-dead

Clean up "const" situation in format_args!().

This cleans up the "const" situation in the format_args!() expansion/lowering.

Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const.

Example expansion/lowering of format_args!() in const:

```rust
// Error: cannot call non-const formatting macro in constant functions
const {
    fmt::Arguments::new_v1( // Now the error is produced here.
        &["Hello, ", "!\n"],
        &[
            fmt::Argument::new_display(&world) // The error used to be produced here.
        ],
    )
}
```
This commit is contained in:
Guillaume Gomez 2025-05-01 22:27:24 +02:00 committed by GitHub
commit 55330297de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

Diff Content Not Available