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