Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Suggest examples of format specifiers in error messages #146123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
IoaNNUwU wants to merge 2 commits into rust-lang:master
base: master
Choose a base branch
Loading
from IoaNNUwU:issue-68293

Conversation

Copy link

@IoaNNUwU IoaNNUwU commented Sep 2, 2025
edited
Loading

Format macro now suggests adding {} if no formatting specifiers are present. It also gives an example:

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:

LL | println!("list: {}", 1, 2, 3);
 | ---------- ^ ^ argument never used
 | | |
 | | argument never used
 | multiple missing formatting specifiers
 |
 = help: consider adding 2 format specifiers

Original issue: #68293
Based on discussion in this PR: #76443

Let me know if something is missing

Copy link
Collaborator

rustbot commented Sep 2, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 2, 2025

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees

@lcnr lcnr

Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /