Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Jan 12, 2026

This tries to clarify a few things regarding fmt syntax:

  • The comment on Parser::word seems to be wrong, as that underscore-prefixed words are just fine. This was changed in Allow any identifier as format arg name #66847.
  • I struggled to follow the description of the width argument. It referred to a "second argument", but I don't know what second argument it is referring to (which is the first?). Either way, I rewrote the paragraph to try to be a little more explicit, and to use shorter sentences.
  • The description of the precision argument wasn't really clear about the distinction of an Nth argument and a named argument. I added a sentence to try to emphasize the difference.
  • IDENTIFIER_OR_KEYWORD was changed recently in Change underscore to be a keyword reference#2049 to include bare _. But fmt named arguments are not allowed to be a bare _.

This tries to clarify a few things regarding fmt syntax:

- The comment on `Parser::word` seems to be wrong, as that
  underscore-prefixed words are just fine. This was changed in
  rust-lang#66847.
- I struggled to follow the description of the width argument. It
  referred to a "second argument", but I don't know what second argument
  it is referring to (which is the first?). Either way, I rewrote the
  paragraph to try to be a little more explicit, and to use shorter
  sentences.
- The description of the precision argument wasn't really clear about
  the distinction of an Nth argument and a named argument. I added
  a sentence to try to emphasize the difference.
- `IDENTIFIER_OR_KEYWORD` was changed recently in
  rust-lang/reference#2049 to include bare `_`.
  But fmt named arguments are not allowed to be a bare `_`.
@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2026

r? @joboet

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

Copy link
Member

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

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

lgmt on compiler side

View changes since this review

@joboet
Copy link
Member

joboet commented Jan 27, 2026

I didn't even know that that was how dynamic arguments were passed, but it's definitely easier to understand with the changed description. And the part about underscore was definitely overlooked in #66847. Thanks!

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 27, 2026

📌 Commit 9a5aa90 has been approved by joboet

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 Jan 27, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 27, 2026
Add some clarifications and fixes for fmt syntax

This tries to clarify a few things regarding fmt syntax:

- The comment on `Parser::word` seems to be wrong, as that underscore-prefixed words are just fine. This was changed in rust-lang#66847.
- I struggled to follow the description of the width argument. It referred to a "second argument", but I don't know what second argument it is referring to (which is the first?). Either way, I rewrote the paragraph to try to be a little more explicit, and to use shorter sentences.
- The description of the precision argument wasn't really clear about the distinction of an Nth argument and a named argument. I added a sentence to try to emphasize the difference.
- `IDENTIFIER_OR_KEYWORD` was changed recently in rust-lang/reference#2049 to include bare `_`. But fmt named arguments are not allowed to be a bare `_`.
rust-bors bot pushed a commit that referenced this pull request Jan 27, 2026
Rollup of 6 pull requests

Successful merges:

 - #151751 (`rust-analyzer` subtree update)
 - #150893 (offload: move (un)register lib into global_ctors)
 - #151013 (Add some clarifications and fixes for fmt syntax)
 - #151666 (compiler: Rename several types/traits for per-query vtables)
 - #151738 (Add `extern crate core` to diagnostic tests)
 - #151759 (Update `browser-ui-test` version to `0.23.3`)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 27, 2026
Add some clarifications and fixes for fmt syntax

This tries to clarify a few things regarding fmt syntax:

- The comment on `Parser::word` seems to be wrong, as that underscore-prefixed words are just fine. This was changed in rust-lang#66847.
- I struggled to follow the description of the width argument. It referred to a "second argument", but I don't know what second argument it is referring to (which is the first?). Either way, I rewrote the paragraph to try to be a little more explicit, and to use shorter sentences.
- The description of the precision argument wasn't really clear about the distinction of an Nth argument and a named argument. I added a sentence to try to emphasize the difference.
- `IDENTIFIER_OR_KEYWORD` was changed recently in rust-lang/reference#2049 to include bare `_`. But fmt named arguments are not allowed to be a bare `_`.
rust-bors bot pushed a commit that referenced this pull request Jan 27, 2026
Rollup of 6 pull requests

Successful merges:

 - #150893 (offload: move (un)register lib into global_ctors)
 - #151013 (Add some clarifications and fixes for fmt syntax)
 - #151449 ([rustdoc] Add regression test for #151411)
 - #151666 (compiler: Rename several types/traits for per-query vtables)
 - #151738 (Add `extern crate core` to diagnostic tests)
 - #151759 (Update `browser-ui-test` version to `0.23.3`)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 27, 2026
Add some clarifications and fixes for fmt syntax

This tries to clarify a few things regarding fmt syntax:

- The comment on `Parser::word` seems to be wrong, as that underscore-prefixed words are just fine. This was changed in rust-lang#66847.
- I struggled to follow the description of the width argument. It referred to a "second argument", but I don't know what second argument it is referring to (which is the first?). Either way, I rewrote the paragraph to try to be a little more explicit, and to use shorter sentences.
- The description of the precision argument wasn't really clear about the distinction of an Nth argument and a named argument. I added a sentence to try to emphasize the difference.
- `IDENTIFIER_OR_KEYWORD` was changed recently in rust-lang/reference#2049 to include bare `_`. But fmt named arguments are not allowed to be a bare `_`.
rust-bors bot pushed a commit that referenced this pull request Jan 28, 2026
Rollup of 6 pull requests

Successful merges:

 - #150893 (offload: move (un)register lib into global_ctors)
 - #151013 (Add some clarifications and fixes for fmt syntax)
 - #151449 ([rustdoc] Add regression test for #151411)
 - #151666 (compiler: Rename several types/traits for per-query vtables)
 - #151738 (Add `extern crate core` to diagnostic tests)
 - #151759 (Update `browser-ui-test` version to `0.23.3`)
rust-bors bot pushed a commit that referenced this pull request Jan 28, 2026
Rollup of 9 pull requests

Successful merges:

 - #151239 (Support trait objects in type info reflection)
 - #150893 (offload: move (un)register lib into global_ctors)
 - #151013 (Add some clarifications and fixes for fmt syntax)
 - #151666 (compiler: Rename several types/traits for per-query vtables)
 - #151738 (Add `extern crate core` to diagnostic tests)
 - #151747 (Update `askama` version to `0.15.2`)
 - #151759 (Update `browser-ui-test` version to `0.23.3`)
 - #151763 (Add FileCheck annotations to simplify_match.rs)
 - #151766 (Fix `x fix`, again)
@rust-bors rust-bors bot merged commit a911804 into rust-lang:main Jan 28, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 28, 2026
rust-timer added a commit that referenced this pull request Jan 28, 2026
Rollup merge of #151013 - ehuss:fmt-clarification, r=joboet

Add some clarifications and fixes for fmt syntax

This tries to clarify a few things regarding fmt syntax:

- The comment on `Parser::word` seems to be wrong, as that underscore-prefixed words are just fine. This was changed in #66847.
- I struggled to follow the description of the width argument. It referred to a "second argument", but I don't know what second argument it is referring to (which is the first?). Either way, I rewrote the paragraph to try to be a little more explicit, and to use shorter sentences.
- The description of the precision argument wasn't really clear about the distinction of an Nth argument and a named argument. I added a sentence to try to emphasize the difference.
- `IDENTIFIER_OR_KEYWORD` was changed recently in rust-lang/reference#2049 to include bare `_`. But fmt named arguments are not allowed to be a bare `_`.
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. T-libs Relevant to the library 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