Skip to content

Commit c1384e8

Browse files
committed
Auto merge of #6805 - ehuss:hint-workspace-exclude, r=alexcrichton
Add more suggestions on how to deal with excluding a package from a workspace. Closes #5418
2 parents 527017f + d7a9212 commit c1384e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,10 @@ impl<'cfg> Workspace<'cfg> {
660660
failure::bail!(
661661
"current package believes it's in a workspace when it's not:\n\
662662
current: {}\n\
663-
workspace: {}\n\n{}",
663+
workspace: {}\n\n{}\n\
664+
Alternatively, to keep it out of the workspace, add the package \
665+
to the `workspace.exclude` array, or add an empty `[workspace]` \
666+
table to the package's manifest.",
664667
self.current_manifest.display(),
665668
root.display(),
666669
extra

tests/testsuite/workspaces.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ current: [..]Cargo.toml
314314
workspace: [..]Cargo.toml
315315
316316
this may be fixable [..]
317+
[..]
317318
",
318319
)
319320
.run();
@@ -779,6 +780,7 @@ workspace: [..]Cargo.toml
779780
780781
this may be fixable by adding `bar` to the `workspace.members` array of the \
781782
manifest located at: [..]
783+
[..]
782784
",
783785
)
784786
.run();
@@ -979,6 +981,7 @@ workspace: [..]
979981
980982
this may be fixable by ensuring that this crate is depended on by the workspace \
981983
root: [..]
984+
[..]
982985
[CREATED] library `bar` package
983986
",
984987
)

0 commit comments

Comments
 (0)