Skip to content

Add unused_format_specs lint #9637

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

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Conversation

Alexendoo
Copy link
Member

Currently catches two cases:

An empty precision specifier:

// the same as {}
println!("{:.}", x);

And using formatting specs on format_args!():

// prints `x.`, not `x    .`
println("{:5}.", format_args!("x"));

changelog: new lint: [unused_format_specs]

@rust-highfive
Copy link

r? @xFrednet

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 12, 2022
@bors
Copy link
Contributor

bors commented Oct 13, 2022

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

@Alexendoo Alexendoo force-pushed the unused-format-specs branch from 52fa719 to 87de785 Compare October 13, 2022 12:14
Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, two small doc adjustments and one question. Then you can r=me 🙃

@Alexendoo Alexendoo force-pushed the unused-format-specs branch from 87de785 to 5343b0d Compare October 17, 2022 11:25
@Alexendoo Alexendoo force-pushed the unused-format-specs branch from 5343b0d to 136c2cd Compare October 17, 2022 11:36
@xFrednet
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 17, 2022

📌 Commit 136c2cd has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 17, 2022

⌛ Testing commit 136c2cd with merge 502e87c...

@bors
Copy link
Contributor

bors commented Oct 17, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing 502e87c to master...

@bors bors merged commit 502e87c into rust-lang:master Oct 17, 2022
@Alexendoo Alexendoo deleted the unused-format-specs branch October 17, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants