See the description of the problem in #4764 (comment).
The gist is that if you invoke cargo inside CARGO_HOME, which is inside a workspace, Cargo should not think that it is inside workspace.
This is the function where I think the fix should be applied:
|
fn find_root(&mut self, manifest_path: &Path) |
Relevant tests are here: https://github.com/rust-lang/cargo/blob/806e487c0e3b6af6203ef8bebf5d6f49faf8909d/tests/workspaces.rs