fix(run): Disambiguate bins from different packages that share a name#15298
Merged
weihanglo merged 12 commits intorust-lang:masterfrom Mar 13, 2025
Merged
fix(run): Disambiguate bins from different packages that share a name#15298weihanglo merged 12 commits intorust-lang:masterfrom
weihanglo merged 12 commits intorust-lang:masterfrom
Conversation
Whether a period was used was dependent on whether a `help:` block is present. That shouldn't make a difference and the rustc dev guide says not to use periods unless multiple sentences are used.
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use |
weihanglo
approved these changes
Mar 13, 2025
tests/testsuite/run.rs
Outdated
Comment on lines
+1023
to
+1024
| bin a in package foo | ||
| example b in package foo |
Member
There was a problem hiding this comment.
Do we want to quote the names? Unsure if it is more readable
Suggested change
| bin a in package foo | |
| example b in package foo | |
| bin `a` in package foo | |
| example `b` in package foo |
Contributor
Author
There was a problem hiding this comment.
I expect we're very inconsistent about our quoting and would be good to decide when we should and try to clean things up.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 14, 2025
Update cargo 15 commits in ab1463d632528e39daf35f263e10c14cbe590ce8..6cf8267012570f63d6b86e85a2ae5627de52df9e 2025-03-08 01:45:05 +0000 to 2025-03-14 15:25:36 +0000 - feat(package): add --exclude-lockfile flag (rust-lang/cargo#15234) - Redox OS is part of the unix family (rust-lang/cargo#15307) - docs(ref): Mention `x.y.*` as a kind of version requirement to avoid. (rust-lang/cargo#15310) - fix(run): Disambiguate bins from different packages that share a name (rust-lang/cargo#15298) - cargo vendor: Add context which workspace failed to resolve (rust-lang/cargo#15297) - docs(ref): Note that target-edition is deprecated (rust-lang/cargo#15292) - refactor(toml): Centralize target descriptions (rust-lang/cargo#15291) - docs(refs): Add `unsafe` to `extern` while using build scripts in Cargo Book (rust-lang/cargo#15294) - Replace unmaintained humantime crate with jiff (rust-lang/cargo#15290) - Add terminal integration via ANSI OSC 9;4 sequences (rust-lang/cargo#14615) - feat: add completions for add --path (rust-lang/cargo#15288) - Allow `term.progress.when` to default (rust-lang/cargo#15287) - docs: spelling and grammar fixes (rust-lang/cargo#15284) - chore(deps): update cargo-semver-checks to v0.40.0 (rust-lang/cargo#15282) - Typo fixes (rust-lang/cargo#15280) r? ghost
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?
This builds on the work done in #15199 to improve target selection errors to also disambiguate when the same binary name is used in multiple packages.
This also makes the errors from #15199 more consistent with the rustc style guide and reduces code duplication.
Fixes #13312
How should we test and review this PR?
This is a first pass and does not do the full
--package foo --bin barsyntax. I wanted to focus on the basic functionality before we iterated on it, e.g. investigating how well we can predict the CLI flags, how much noise they might add, etc.Additional information