Skip to content
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

Merged
merged 2 commits into from
Aug 19, 2022

Conversation

hi-rustin
Copy link
Member

@hi-rustin hi-rustin commented Aug 17, 2022

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?

  • unit test

@rust-highfive
Copy link

r? @epage

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2022
@hi-rustin
Copy link
Member Author

I'll add a unit test later.

@hi-rustin hi-rustin force-pushed the rustin-patch-wrong-names branch 4 times, most recently from a968b12 to 6ff1db9 Compare August 18, 2022 13:22
@hi-rustin hi-rustin marked this pull request as ready for review August 18, 2022 13:24
@hi-rustin hi-rustin requested a review from epage August 18, 2022 14:02
Copy link
Contributor

@epage epage left a 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 Show resolved Hide resolved
writeln!(msg, "No {} targets available.", target_desc)?;
anyhow::bail!(msg);
}
writeln!(msg, "Available {} targets:", target_desc)?;
Copy link
Contributor

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

Copy link
Member Author

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.

src/cargo/ops/cargo_compile.rs Outdated Show resolved Hide resolved
@epage
Copy link
Contributor

epage commented Aug 19, 2022

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 19, 2022

📌 Commit 99b3564 has been approved by epage

It is now in the queue for this repository.

@bors 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 Aug 19, 2022
@bors
Copy link
Collaborator

bors commented Aug 19, 2022

⌛ Testing commit 99b3564 with merge 6066463...

@bors
Copy link
Collaborator

bors commented Aug 19, 2022

☀️ Test successful - checks-actions
Approved by: epage
Pushing 6066463 to master...

@bors bors merged commit 6066463 into rust-lang:master Aug 19, 2022
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)
@ehuss ehuss added this to the 1.65.0 milestone Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message for wrong target names
5 participants