Conversation
(cherry picked from commit 8beec62)
(cherry picked from commit f3e9dfa)
(cherry picked from commit 39f2d25)
This commit fixes several issues with the format string parsing of the `#[diagnostic::on_unimplemented]` attribute that were pointed out by @ehuss. In detail it fixes: * Appearing format specifiers (display, etc). For these we generate a warning that the specifier is unsupported. Otherwise we ignore them * Positional arguments. For these we generate a warning that positional arguments are unsupported in that location and replace them with the format string equivalent (so `{}` or `{n}` where n is the index of the positional argument) * Broken format strings with enclosed }. For these we generate a warning about the broken format string and set the emitted message literally to the provided unformatted string * Unknown format specifiers. For these we generate an additional warning about the unknown specifier. Otherwise we emit the literal string as message. This essentially makes those strings behave like `format!` with the minor difference that we do not generate hard errors but only warnings. After that we continue trying to do something unsuprising (mostly either ignoring the broken parts or falling back to just giving back the literal string as provided). Fix rust-lang#122391 (cherry picked from commit 5568c56)
Collaborator
|
Member
Author
|
@bors r+ rollup=never |
Collaborator
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 28, 2024
[beta] backports - Do not eat nested expressions' results in `MayContainYieldPoint` format args visitor rust-lang#122680 - Fix heading anchors in doc pages. rust-lang#122693 - Make `#[diagnostic::on_unimplemented]` format string parsing more robust rust-lang#122402 r? cuviper
Collaborator
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
Member
|
@bors retry #122671 (comment) |
Errors started showing up, and I read somewhere that this might be because of old ninja versions. This ninja version is indeed *ancient*. ``` multiple outputs aren't (yet?) supported by depslog; bring this up on the mailing list if it affects you ``` (cherry picked from commit b546764)
Member
Author
|
@bors r+ |
Collaborator
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
1 similar comment
Collaborator
|
☀️ Test successful - checks-actions |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MayContainYieldPointformat args visitor Do not eat nested expressions' results inMayContainYieldPointformat args visitor #122680#[diagnostic::on_unimplemented]format string parsing more robust Make#[diagnostic::on_unimplemented]format string parsing more robust #122402r? cuviper