feat: improve parent workspace search error msg#16669
Merged
epage merged 2 commits intorust-lang:masterfrom Feb 27, 2026
Merged
feat: improve parent workspace search error msg#16669epage merged 2 commits intorust-lang:masterfrom
epage merged 2 commits intorust-lang:masterfrom
Conversation
Signed-off-by: 0xPoe <techregister@pm.me> fix Signed-off-by: 0xPoe <techregister@pm.me>
57b6a9f to
7b4cfb6
Compare
0xPoe
commented
Feb 25, 2026
Member
Author
There was a problem hiding this comment.
🔢 Self-check (PR reviewed by myself and ready for feedback)
-
Code compiles successfully
-
Unit tests added
-
No AI-generated elegant nonsense in PR.
-
Comments added where necessary
-
PR title and description updated
-
Documentation PR created (or confirmed not needed)
-
PR size is reasonable
@rustbot ready
src/cargo/core/workspace.rs
Outdated
| parent directories for a workspace root from `{}`\n\ | ||
| \n\ | ||
| Cargo is searching for a workspace in parent directories.\n\ | ||
| To keep this package out of the parent workspace, add an empty \ |
Member
Author
There was a problem hiding this comment.
From current tests, it seems this note is okay, and no false positive cases have been found. However, please let me know if you think this message might be confusing in any other situations.
Member
Author
|
r? @epage |
epage
reviewed
Feb 25, 2026
Signed-off-by: 0xPoe <techregister@pm.me>
7b4cfb6 to
43f2b10
Compare
epage
approved these changes
Feb 27, 2026
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Mar 5, 2026
Update cargo submodule 11 commits in f298b8c82da0cba538516b45b04a480fc501d4c0..708100e0d0fe64ad66e05dc5a19110936a5ca4b1 2026-02-24 21:59:20 +0000 to 2026-03-05 02:03:19 +0000 - Docs: Clarify build script current directory (rust-lang/cargo#16703) - test(replace): Mark a test as non-deterministic (rust-lang/cargo#16700) - chore: bump to 0.97.0; update changelog (rust-lang/cargo#16699) - fix(tests): allow for 'could not' as well as couldn't in test output (rust-lang/cargo#16698) - chore: Upgrade dependencies (rust-lang/cargo#16690) - chore(deps): update crate-ci/typos action to v1.44.0 (rust-lang/cargo#16685) - feat(help): display manpage for nested commands (rust-lang/cargo#16432) - feat: improve parent workspace search error msg (rust-lang/cargo#16669) - feat(fix): Inject an edition into scripts (rust-lang/cargo#16678) - fix(toml): Clarify the edition is on the float (rust-lang/cargo#16676) - fix(toml): show required rust-version in unstable edition error (rust-lang/cargo#16653)
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Mar 5, 2026
Update cargo submodule 12 commits in f298b8c82da0cba538516b45b04a480fc501d4c0..90ed291a50efc459e0c380d7b455777ed41c6799 2026-02-24 21:59:20 +0000 to 2026-03-05 15:11:25 +0000 - test(git): Mark a test as non-deterministic (rust-lang/cargo#16706) - Docs: Clarify build script current directory (rust-lang/cargo#16703) - test(replace): Mark a test as non-deterministic (rust-lang/cargo#16700) - chore: bump to 0.97.0; update changelog (rust-lang/cargo#16699) - fix(tests): allow for 'could not' as well as couldn't in test output (rust-lang/cargo#16698) - chore: Upgrade dependencies (rust-lang/cargo#16690) - chore(deps): update crate-ci/typos action to v1.44.0 (rust-lang/cargo#16685) - feat(help): display manpage for nested commands (rust-lang/cargo#16432) - feat: improve parent workspace search error msg (rust-lang/cargo#16669) - feat(fix): Inject an edition into scripts (rust-lang/cargo#16678) - fix(toml): Clarify the edition is on the float (rust-lang/cargo#16676) - fix(toml): show required rust-version in unstable edition error (rust-lang/cargo#16653)
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Mar 5, 2026
Update cargo submodule 12 commits in f298b8c82da0cba538516b45b04a480fc501d4c0..90ed291a50efc459e0c380d7b455777ed41c6799 2026-02-24 21:59:20 +0000 to 2026-03-05 15:11:25 +0000 - test(git): Mark a test as non-deterministic (rust-lang/cargo#16706) - Docs: Clarify build script current directory (rust-lang/cargo#16703) - test(replace): Mark a test as non-deterministic (rust-lang/cargo#16700) - chore: bump to 0.97.0; update changelog (rust-lang/cargo#16699) - fix(tests): allow for 'could not' as well as couldn't in test output (rust-lang/cargo#16698) - chore: Upgrade dependencies (rust-lang/cargo#16690) - chore(deps): update crate-ci/typos action to v1.44.0 (rust-lang/cargo#16685) - feat(help): display manpage for nested commands (rust-lang/cargo#16432) - feat: improve parent workspace search error msg (rust-lang/cargo#16669) - feat(fix): Inject an edition into scripts (rust-lang/cargo#16678) - fix(toml): Clarify the edition is on the float (rust-lang/cargo#16676) - fix(toml): show required rust-version in unstable edition error (rust-lang/cargo#16653)
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Mar 6, 2026
Update cargo submodule 12 commits in f298b8c82da0cba538516b45b04a480fc501d4c0..90ed291a50efc459e0c380d7b455777ed41c6799 2026-02-24 21:59:20 +0000 to 2026-03-05 15:11:25 +0000 - test(git): Mark a test as non-deterministic (rust-lang/cargo#16706) - Docs: Clarify build script current directory (rust-lang/cargo#16703) - test(replace): Mark a test as non-deterministic (rust-lang/cargo#16700) - chore: bump to 0.97.0; update changelog (rust-lang/cargo#16699) - fix(tests): allow for 'could not' as well as couldn't in test output (rust-lang/cargo#16698) - chore: Upgrade dependencies (rust-lang/cargo#16690) - chore(deps): update crate-ci/typos action to v1.44.0 (rust-lang/cargo#16685) - feat(help): display manpage for nested commands (rust-lang/cargo#16432) - feat: improve parent workspace search error msg (rust-lang/cargo#16669) - feat(fix): Inject an edition into scripts (rust-lang/cargo#16678) - fix(toml): Clarify the edition is on the float (rust-lang/cargo#16676) - fix(toml): show required rust-version in unstable edition error (rust-lang/cargo#16653)
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?
ref #6706 (comment)
I added a message to explain why we search upward and identify the file that caused the issue.
I also included a note to add an empty
[workspace]as a workaround.How to test and review this PR?
Check the unit tests.
r? @ghost