diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-10 20:29:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 20:29:06 +0200 |
| commit | f48c1d85b282d2b6ae0267d098afc72a4a5977f8 (patch) | |
| tree | cf95703cc9816d29e3184255233702579d868495 /compiler/rustc_codegen_llvm/src | |
| parent | fc6beb3034c766dff3ccc534b011bb9141cc9ee7 (diff) | |
| parent | 43a6f56ca78295164dbf964695a43be7e35b1994 (diff) | |
| download | rust-f48c1d85b282d2b6ae0267d098afc72a4a5977f8.tar.gz rust-f48c1d85b282d2b6ae0267d098afc72a4a5977f8.zip | |
Rollup merge of #146123 - IoaNNUwU:issue-68293, r=estebank
Suggest examples of format specifiers in error messages
Format macro now suggests adding `{}` if no formatting specifiers are present. It also gives an example:
```rust
LL | println!("Hello", "World");
| ------- ^^^^^^^ argument never used
| |
| formatting specifier missing
|
= note: format specifiers use curly braces: `{}`
help: consider adding format specifier
|
LL | println!("Hello{}", "World");
| ++
```
When one or more `{}` are present, it doesn't show 'format specifiers use curly braces: `{}`' and example, just small hint on how many you missing:
```rust
LL | println!("list: {}", 1, 2, 3);
| ---------- ^ ^ argument never used
| | |
| | argument never used
| multiple missing formatting specifiers
|
= help: consider adding 2 format specifiers
```
Original issue: rust-lang/rust#68293
Based on discussion in this PR: rust-lang/rust#76443
Let me know if something is missing
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
