Skip to content

Conversation

0xsot
Copy link
Contributor

@0xsot 0xsot commented May 9, 2025

What does this PR try to resolve?

via issue #15505, Cargo currently errors on

[dependencies]
crc32fast = true

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 updates cargo so that when you write dep = true, the error also suggests:

dep = { workspace = true }
dep.workspace = true

How should we test and review this PR?

In a workspace crate’s Cargo.toml, add

[dependencies]
crc32fast = true

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

@rustbot
Copy link
Collaborator

rustbot commented May 9, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2025
@epage
Copy link
Contributor

epage commented May 9, 2025

Mind squashing that last commit into the previous one?

@0xsot 0xsot force-pushed the workspace-hint-boolean-deps branch from f47ac3a to b3ce3eb Compare May 9, 2025 20:01
@weihanglo
Copy link
Member

@rustbot author

Could you rebase onto master? Thanks!

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Aug 17, 2025
0xsot added 2 commits August 19, 2025 18:15
hint for only bad dependency true literal and rename unit test to match
@0xsot 0xsot force-pushed the workspace-hint-boolean-deps branch from b3ce3eb to 5dd597b Compare August 19, 2025 17:15
@0xsot
Copy link
Contributor Author

0xsot commented Aug 19, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Aug 19, 2025
@epage
Copy link
Contributor

epage commented Aug 19, 2025

Looks like a new nightly broke build-std. I've asked for input on fixing it at #t-cargo > `build-std` test failure @ 💬

@weihanglo weihanglo added this pull request to the merge queue Aug 21, 2025
Merged via the queue into rust-lang:master with commit 4434ed8 Aug 21, 2025
65 of 69 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2025
bors added a commit to rust-lang/rust that referenced this pull request Aug 23, 2025
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
@rustbot rustbot added this to the 1.91.0 milestone Aug 23, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 24, 2025
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
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Aug 25, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-manifest Area: Cargo.toml issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants