-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve error message for wrong target names #10999
Conversation
r? @epage (rust-highfive has picked a reviewer for you, use r? to override) |
I'll add a unit test later. |
a968b12
to
6ff1db9
Compare
6ff1db9
to
5ef6a6b
Compare
5ef6a6b
to
b0c01ba
Compare
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.
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)?; |
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.
nit: It looks like we are inconsistent on whether to capitalize this. Let's lean towards not capitalizing for now
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.
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 <[email protected]>
b0c01ba
to
99b3564
Compare
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
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)
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?