mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Auto merge of #9686 - hi-rustin:rustin-patch-error, r=alexcrichton
When a dependency does not have a version, git or path, fails directly Make this warning be an error. ref: https://github.com/rust-lang/cargo/issues/9682#issuecomment-879108193
This commit is contained in:
commit
98d5d10268
@ -1707,14 +1707,11 @@ impl<P: ResolveToPath> DetailedTomlDependency<P> {
|
|||||||
kind: Option<DepKind>,
|
kind: Option<DepKind>,
|
||||||
) -> CargoResult<Dependency> {
|
) -> CargoResult<Dependency> {
|
||||||
if self.version.is_none() && self.path.is_none() && self.git.is_none() {
|
if self.version.is_none() && self.path.is_none() && self.git.is_none() {
|
||||||
let msg = format!(
|
bail!(
|
||||||
"dependency ({}) specified without \
|
"dependency ({}) specified without \
|
||||||
providing a local path, Git repository, or \
|
providing a local path, Git repository, or version to use.",
|
||||||
version to use. This will be considered an \
|
|
||||||
error in future versions",
|
|
||||||
name_in_toml
|
name_in_toml
|
||||||
);
|
);
|
||||||
cx.warnings.push(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(version) = &self.version {
|
if let Some(version) = &self.version {
|
||||||
|
@ -796,10 +796,14 @@ fn empty_dependencies() {
|
|||||||
Package::new("bar", "0.0.1").publish();
|
Package::new("bar", "0.0.1").publish();
|
||||||
|
|
||||||
p.cargo("build")
|
p.cargo("build")
|
||||||
.with_stderr_contains(
|
.with_status(101)
|
||||||
|
.with_stderr(
|
||||||
"\
|
"\
|
||||||
warning: dependency (bar) specified without providing a local path, Git repository, or version \
|
[ERROR] failed to parse manifest at `[..]`
|
||||||
to use. This will be considered an error in future versions
|
|
||||||
|
Caused by:
|
||||||
|
dependency (bar) specified without providing a local path, Git repository, or version \
|
||||||
|
to use.
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
.run();
|
.run();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user