-
Notifications
You must be signed in to change notification settings - Fork 2.6k
suggest workspace hints for boolean dependencies #15507
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
suggest workspace hints for boolean dependencies #15507
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
Mind squashing that last commit into the previous one? |
f47ac3a
to
b3ce3eb
Compare
@rustbot author Could you rebase onto master? Thanks! |
Reminder, once the PR becomes ready for a review, use |
hint for only bad dependency true literal and rename unit test to match
b3ce3eb
to
5dd597b
Compare
@rustbot ready |
Looks like a new nightly broke |
Update cargo submodule 12 commits in 71eb84f21aef43c07580c6aed6f806a6299f5042..623d536836b4cde09ce38609232a024d5b25da81 2025-08-17 17:18:56 +0000 to 2025-08-22 19:05:52 +0000 - test(frontmatter): Match test updates in rustc (rust-lang/cargo#15878) - chore: fix some typos in comment (rust-lang/cargo#15877) - Add Arm64 Windows CI jobs (rust-lang/cargo#15790) - suggest workspace hints for boolean dependencies (rust-lang/cargo#15507) - make `UnitGenerator` public in cargo-as-a-library (rust-lang/cargo#15873) - Linting system (rust-lang/cargo#15865) - Switch to using native mdbook fragment redirects (rust-lang/cargo#15861) - docs(profile): revert wrong statement of lto options' optimization (rust-lang/cargo#15855) - docs: avoid ambiguity between update and fetch (rust-lang/cargo#15860) - docs: mention how Cargo fetch git submodules (rust-lang/cargo#15853) - feat(unstable): Added `-Zbuild-dir-new-layout` unstable feature (rust-lang/cargo#15848) - Implement `host`-target substitution (rust-lang/cargo#15838) r? ghost
Update cargo submodule 12 commits in 71eb84f21aef43c07580c6aed6f806a6299f5042..623d536836b4cde09ce38609232a024d5b25da81 2025-08-17 17:18:56 +0000 to 2025-08-22 19:05:52 +0000 - test(frontmatter): Match test updates in rustc (rust-lang/cargo#15878) - chore: fix some typos in comment (rust-lang/cargo#15877) - Add Arm64 Windows CI jobs (rust-lang/cargo#15790) - suggest workspace hints for boolean dependencies (rust-lang/cargo#15507) - make `UnitGenerator` public in cargo-as-a-library (rust-lang/cargo#15873) - Linting system (rust-lang/cargo#15865) - Switch to using native mdbook fragment redirects (rust-lang/cargo#15861) - docs(profile): revert wrong statement of lto options' optimization (rust-lang/cargo#15855) - docs: avoid ambiguity between update and fetch (rust-lang/cargo#15860) - docs: mention how Cargo fetch git submodules (rust-lang/cargo#15853) - feat(unstable): Added `-Zbuild-dir-new-layout` unstable feature (rust-lang/cargo#15848) - Implement `host`-target substitution (rust-lang/cargo#15838) r? ghost
Update cargo submodule 12 commits in 71eb84f21aef43c07580c6aed6f806a6299f5042..623d536836b4cde09ce38609232a024d5b25da81 2025-08-17 17:18:56 +0000 to 2025-08-22 19:05:52 +0000 - test(frontmatter): Match test updates in rustc (rust-lang/cargo#15878) - chore: fix some typos in comment (rust-lang/cargo#15877) - Add Arm64 Windows CI jobs (rust-lang/cargo#15790) - suggest workspace hints for boolean dependencies (rust-lang/cargo#15507) - make `UnitGenerator` public in cargo-as-a-library (rust-lang/cargo#15873) - Linting system (rust-lang/cargo#15865) - Switch to using native mdbook fragment redirects (rust-lang/cargo#15861) - docs(profile): revert wrong statement of lto options' optimization (rust-lang/cargo#15855) - docs: avoid ambiguity between update and fetch (rust-lang/cargo#15860) - docs: mention how Cargo fetch git submodules (rust-lang/cargo#15853) - feat(unstable): Added `-Zbuild-dir-new-layout` unstable feature (rust-lang/cargo#15848) - Implement `host`-target substitution (rust-lang/cargo#15838) r? ghost
What does this PR try to resolve?
via issue #15505, Cargo currently errors on
with a message about
expected a version string or a detailed dependency
It doesn’t hint that you can depend on a workspace member. This PR updatescargo
so that when you write dep = true, the error also suggests:How should we test and review this PR?
In a workspace crate’s Cargo.toml, add
Run
cargo build
and you should see the enhanced error with the two workspace hints.Additional information
Regarding support for int/float, we only need a special case for boolean because they’re the only values that get the
workspace hint
. Everything else just uses the normal detailed dependency error