about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/tests/complexity.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-01 22:27:24 +0200
committerGitHub <noreply@github.com>2025-05-01 22:27:24 +0200
commit6cb75d88ebe12675eb359d7c0ecf73cb55ff4ccc (patch)
treef9defb0a63cfdffd2f1b3f6a0c2edfd0d06173b7 /compiler/rustc_pattern_analysis/tests/complexity.rs
parent786a53d2dbc5fa34d20b541176976ddf421ddd31 (diff)
parent86c6e7911d2ccf69f8306f5bfb10233025dc8e22 (diff)
downloadrust-6cb75d88ebe12675eb359d7c0ecf73cb55ff4ccc.tar.gz
rust-6cb75d88ebe12675eb359d7c0ecf73cb55ff4ccc.zip
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.
        ],
    )
}
```
Diffstat (limited to 'compiler/rustc_pattern_analysis/tests/complexity.rs')
0 files changed, 0 insertions, 0 deletions