-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add some clarifications and fixes for fmt syntax #151013
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
+11
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 `_`.
Collaborator
Kivooeo
reviewed
Jan 12, 2026
Member
There was a problem hiding this 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
Kivooeo
approved these changes
Jan 12, 2026
Member
Contributor
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-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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This tries to clarify a few things regarding fmt syntax:
Parser::wordseems to be wrong, as that underscore-prefixed words are just fine. This was changed in Allow any identifier as format arg name #66847.IDENTIFIER_OR_KEYWORDwas 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_.