mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Issue #5087
* targeted error message for virtual manifests * assert correct error message
This commit is contained in:
parent
7334fe42b8
commit
05b896ac90
@ -156,11 +156,13 @@ impl<'a> Packages<'a> {
|
||||
}
|
||||
};
|
||||
if specs.is_empty() {
|
||||
bail!("Workspace contains no members to be compiled. \
|
||||
Be sure all workspace members haven't been excluded")
|
||||
} else {
|
||||
Ok(specs)
|
||||
match ws.is_virtual() {
|
||||
true => bail!("manifest path `{}` contains no package: The manifest is virtual, \
|
||||
and the workspace has no members.", ws.root().display()),
|
||||
false => bail!("no packages to compile"),
|
||||
}
|
||||
}
|
||||
Ok(specs)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,7 @@ fn cargo_compile_with_workspace_excluded() {
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all").arg("--exclude").arg("foo"),
|
||||
execs().with_stderr_does_not_contain("[..]virtual[..]")
|
||||
.with_stderr_contains("[..]no packages to compile")
|
||||
.with_status(101));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user