Skip to content

Commit 84f1dc1

Browse files
committed
Passing a relative path to Workspace now bails with proper message.
Previously, this failure will return an unhelpful warning. This commit adds an error message saying that the argument for `manifest_path` must be an absolute path.
1 parent 9907039 commit 84f1dc1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ impl<'cfg> Workspace<'cfg> {
147147
ws.target_dir = config.target_dir()?;
148148

149149
if manifest_path.is_relative() {
150-
ws.root_manifest = Some(std::env::current_dir()?);
150+
anyhow::bail!(
151+
"manifest_path:{:?} is not an absolute path. Please provide an absolute path.",
152+
manifest_path
153+
)
151154
} else {
152155
ws.root_manifest = ws.find_root(manifest_path)?;
153156
}

0 commit comments

Comments
 (0)