Skip to content

warn on empty precision, but only when width present#156143

Closed
hkBst wants to merge 1 commit into
rust-lang:mainfrom
hkBst:format_parse2
Closed

warn on empty precision, but only when width present#156143
hkBst wants to merge 1 commit into
rust-lang:mainfrom
hkBst:format_parse2

Conversation

@hkBst

@hkBst hkBst commented May 4, 2026

Copy link
Copy Markdown
Member

Reworking of #136638.

Fixes #131159 by warning on missing precision only if there is a width specified.

This is the only case where a previous crater run caught a bug because "{:2.?}" was written but "{:.2?}" was meant.

r? @m-ou-se

Feel free to close if this is still deemed undesirable.

@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 May 4, 2026
@rust-bors

rust-bors Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #157558) made this pull request unmergeable. Please resolve the merge conflicts.

@Enselic

Enselic commented Jun 26, 2026

Copy link
Copy Markdown
Member

This PR doesn't seem to do what was last discussed in #136638, namely to add a clippy lint for this. Was that agreement changed in discussions that took place later elsewhere , perhaps?

@hkBst

hkBst commented Jun 27, 2026

Copy link
Copy Markdown
Member Author

@Enselic No, this is just a continuation of that discussion, with a proposal for a much quieter version of the original. Like you said it is not the preferred solution, so there's a good chance this will not go anywhere, but I wanted to present it anyway, since it was a simple change of the original.

I'm not planning on doing the preferred (clippy) version, since it seems too big of a project for me right now, but someone else should definitely feel free to go for that. You?

@Enselic

Enselic commented Jun 30, 2026

Copy link
Copy Markdown
Member

Ok, I see, thanks for explaining. Not sure it makes sense to keep this PR open though, since changing the compiler for this has already been decided against.

Since you said

Feel free to close if this is still deemed undesirable.

I will go ahead and close this.

@Enselic Enselic closed this Jun 30, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

absent precision parameter for floating point format string is undocumented

4 participants