From d7a92124099145b87eb2133c4b18990d4c66e2a5 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 31 Mar 2019 17:48:15 -0700 Subject: [PATCH] Add more suggestions on how to deal with excluding a package from a workspace. --- src/cargo/core/workspace.rs | 5 ++++- tests/testsuite/workspaces.rs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs index 76bedfaf3f0..45b6a7877ae 100644 --- a/src/cargo/core/workspace.rs +++ b/src/cargo/core/workspace.rs @@ -660,7 +660,10 @@ impl<'cfg> Workspace<'cfg> { failure::bail!( "current package believes it's in a workspace when it's not:\n\ current: {}\n\ - workspace: {}\n\n{}", + workspace: {}\n\n{}\n\ + Alternatively, to keep it out of the workspace, add the package \ + to the `workspace.exclude` array, or add an empty `[workspace]` \ + table to the package's manifest.", self.current_manifest.display(), root.display(), extra diff --git a/tests/testsuite/workspaces.rs b/tests/testsuite/workspaces.rs index 1e720d3304e..8b8f79c9a67 100644 --- a/tests/testsuite/workspaces.rs +++ b/tests/testsuite/workspaces.rs @@ -314,6 +314,7 @@ current: [..]Cargo.toml workspace: [..]Cargo.toml this may be fixable [..] +[..] ", ) .run(); @@ -779,6 +780,7 @@ workspace: [..]Cargo.toml this may be fixable by adding `bar` to the `workspace.members` array of the \ manifest located at: [..] +[..] ", ) .run(); @@ -979,6 +981,7 @@ workspace: [..] this may be fixable by ensuring that this crate is depended on by the workspace \ root: [..] +[..] [CREATED] library `bar` package ", )