docs: clarify dash replacement rule in target name#13887
Merged
Conversation
Collaborator
Member
|
@bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 11, 2024
Update cargo 7 commits in 0ca60e940821c311c9b25a6423b59ccdbcea218f..4de0094ac78743d2c8ff682489e35c8a7cafe8e4 2024-05-08 01:54:25 +0000 to 2024-05-09 16:09:22 +0000 - Fix docs for unstable script feature (rust-lang/cargo#13893) - Refactor cargo lint tests (rust-lang/cargo#13880) - test(rustfix): run some tests only on nightly (rust-lang/cargo#13890) - Old syntax suggestion (rust-lang/cargo#13874) - docs: clarify dash replacement rule in target name (rust-lang/cargo#13887) - Add local-only build scripts example in check-cfg docs (rust-lang/cargo#13884) - docs(changelog): also mention `--message-format=json` (rust-lang/cargo#13882) r? ghost
Member
lol, I was just about to open a PR for fixing that in the docs and then I discovered it's already fixed on |
n-ramacciotti
added a commit
to n-ramacciotti/svsm
that referenced
this pull request
Jul 7, 2026
When specifying `--message-format=json-render-diagnostics`, Cargo produces an output where potential '-' in target.name are converted in '_' for lib crates. [1] This seems to be the expected behavior. [2] Update `find_test_executable` to account for that. [1] rust-lang/cargo#13867 [2] rust-lang/cargo#13887 Signed-off-by: Nicola Ramacciotti <niko.ramak@gmail.com>
n-ramacciotti
added a commit
to n-ramacciotti/svsm
that referenced
this pull request
Jul 8, 2026
When specifying `--message-format=json-render-diagnostics`, Cargo produces an output where potential '-' in target.name are converted in '_' for lib crates. [1] This seems to be the expected behavior. [2] Update `find_test_executable` to account for that. Although not strictly necessary, as `bin` won't be produced during test in svsm since they have `test=false`, introduce an `ArtifactKind` for all the possible targets reported in the compiler message and update the guard to check for the presence of the `lib` target, to improve robustness. [1] rust-lang/cargo#13867 [2] rust-lang/cargo#13887 Suggested-by: Carlos López <clopez@suse.de> Signed-off-by: Nicola Ramacciotti <niko.ramak@gmail.com>
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.
What does this PR try to resolve?
A follow-up of #13867 and #13882.
This clarifies that dashes will be replaced in every JSON messages documentation we have.
Also fixes a documentation bug that Cargo in fact doesn't replace dashes for the default binary (
src/main.rs).How should we test and review this PR?
Read the doc and suggest changes.
Additional information