Skip to content

Conversation

@nyurik
Copy link
Contributor

@nyurik nyurik commented Feb 9, 2026

Make format-like macro calls look similar to what cargo fmt does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a clippy lint to make this process automatic.

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.
@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 Feb 9, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2026

r? @mati865

rustbot has assigned @mati865.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, types
  • compiler, types expanded to 25 candidates
  • Random selection from 13 candidates

@xizheyin
Copy link
Member

xizheyin commented Feb 9, 2026

Should commas in the same module be removed in places like this? 🤔
https://github.com/rust-lang/rust/blob/main/compiler/rustc_trait_selection/src/traits/normalize.rs#L124

@nyurik
Copy link
Contributor Author

nyurik commented Feb 9, 2026

@xizheyin that's a good question. The lint i wrote wouldn't catch these unless they have #[clippy::format_args].

In this specific case, I think it is a good idea to remove that comma as it doesn't seem to have any impact. If it does, and both variants compile and pass tests, it would be a more significant problem - i.e. a comma becoming an important parameter to a "function-like" macro call is just wrong.

@mati865
Copy link
Member

mati865 commented Feb 10, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit 1fa165d has been approved by mati865

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…n, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…n, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149937 (try enabling `linker-messages` by default again)
 - #151733 (Use function shims to make sure EII works on apple targets)
 - #152120 (Don't ICE on layout error in vtable computation)
 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #151142 (Support ADT types in type info reflection)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2026
…n, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
…n, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
…n, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
rust-bors bot pushed a commit that referenced this pull request Feb 11, 2026
Rollup of 10 pull requests

Successful merges:

 - #152120 (Don't ICE on layout error in vtable computation)
 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
…n, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
rust-bors bot pushed a commit that referenced this pull request Feb 11, 2026
Rollup of 9 pull requests

Successful merges:

 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
@rust-bors rust-bors bot merged commit dbb1c20 into rust-lang:main Feb 12, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 12, 2026
rust-timer added a commit that referenced this pull request Feb 12, 2026
Rollup merge of #152372 - nyurik:clippy-rustc_trait_selection, r=mati865

style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](rust-lang/rust-clippy#16530) to make this process automatic.
@nyurik nyurik deleted the clippy-rustc_trait_selection branch February 12, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants