-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Docs: fix incorrect copy-paste for new X?
in formatting strings
#49161
Merged
Conversation
This file contains 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
SimonSapin
referenced
this pull request
Mar 19, 2018
Add hexadecimal formatting of integers with fmt::Debug This can be used for integers within a larger types which implements Debug (possibly through derive) but not fmt::UpperHex or fmt::LowerHex. ```rust assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]"); assert!(format!("{:02X?}", b"Foo\0") == "[46, 6F, 6F, 00]"); ``` RFC: rust-lang/rfcs#2226 The new formatting string syntax (`x?` and `X?`) is insta-stable in this PR because I don’t know how to change a built-in proc macro’s behavior based of a feature gate. I can look into adding that, but I also strongly suspect that keeping this feature unstable for a time period would not be useful as possibly no-one would use it during that time. This PR does not add the new (public) `fmt::Formatter` proposed in the API because: * There was some skepticism on response to this part of the RFC * It is not possible to implement as-is without larger changes to `fmt`, because `Formatter` at the moment has no easy way to tell apart for example `Octal` from `Binary`: it only has a function pointer for the relevant `fmt()` method. If some integer-like type outside of `std` want to implement this behavior, another RFC will likely need to propose a different public API for `Formatter`.
SimonSapin
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
labels
Mar 19, 2018
D'oh! The most obvious things are always the hardest to see. @bors r+ |
📌 Commit 741d7a5 has been approved by |
bors
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
Mar 19, 2018
Closed
⌛ Testing commit 741d7a5 with merge 02e297165031c3a7eebc4eca4282cd4da810bc93... |
Wut, both Travis and AppVeyor failed to clone the repository, and bors didn't update. @bors retry rollup |
@pietroalbini: 🔑 Insufficient privileges: Not in reviewers |
@bors: retry bors is having a rough day... |
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Mar 20, 2018
…rAus Docs: fix incorrect copy-paste for new `X?` in formatting strings
bors
added a commit
that referenced
this pull request
Mar 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-libs-api
Relevant to the library API 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.
No description provided.