Improve error message for wrong target names#10999
Merged
bors merged 2 commits intorust-lang:masterfrom Aug 19, 2022
Merged
Conversation
|
r? @epage (rust-highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
I'll add a unit test later. |
epage
reviewed
Aug 17, 2022
a968b12 to
6ff1db9
Compare
6ff1db9 to
5ef6a6b
Compare
5ef6a6b to
b0c01ba
Compare
epage
reviewed
Aug 18, 2022
Contributor
epage
left a comment
There was a problem hiding this comment.
The main "blocker" is the collapsing of messages. The others you can handle as you wish.
And I put "blocker" in quotes because I am willing to bend on it depending on what peoples thoughts are
src/cargo/ops/cargo_compile.rs
Outdated
| writeln!(msg, "No {} targets available.", target_desc)?; | ||
| anyhow::bail!(msg); | ||
| } | ||
| writeln!(msg, "Available {} targets:", target_desc)?; |
Contributor
There was a problem hiding this comment.
nit: It looks like we are inconsistent on whether to capitalize this. Let's lean towards not capitalizing for now
Member
Author
There was a problem hiding this comment.
It refers to:
> cargo run --bin
error: "--bin" takes one argument.
Available binaries:
abc
xyz
So I prefer to keep it.
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
b0c01ba to
99b3564
Compare
Contributor
|
Thanks! @bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 24, 2022
Update cargo 7 commits in 9809f8ff33c2b998919fd0432c626f0f7323697a..6da726708a4406f31f996d813790818dce837161 2022-08-16 22:10:06 +0000 to 2022-08-23 21:39:56 +0000 - Update non-ASCII crate name warning message (rust-lang/cargo#11017) - Add more tests for aggressive or precise update (rust-lang/cargo#11011) - Ignore broken but excluded file during traversing (rust-lang/cargo#11008) - Improve error message for wrong target names (rust-lang/cargo#10999) - Bump snapbox to 0.3 (rust-lang/cargo#11005) - remove missed reference to workspace inheritance in unstable.md (rust-lang/cargo#11001) - Warning when precise or aggressive without -p flag (rust-lang/cargo#10988)
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?
Fixes #10982
We can print all available targets for users.
How should we test and review this PR?