Skip to content

Commit 98d5d10

Browse files
committed
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: #9682 (comment)
2 parents 3658906 + 5c66070 commit 98d5d10

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,14 +1707,11 @@ impl<P: ResolveToPath> DetailedTomlDependency<P> {
17071707
kind: Option<DepKind>,
17081708
) -> CargoResult<Dependency> {
17091709
if self.version.is_none() && self.path.is_none() && self.git.is_none() {
1710-
let msg = format!(
1710+
bail!(
17111711
"dependency ({}) specified without \
1712-
providing a local path, Git repository, or \
1713-
version to use. This will be considered an \
1714-
error in future versions",
1712+
providing a local path, Git repository, or version to use.",
17151713
name_in_toml
17161714
);
1717-
cx.warnings.push(msg);
17181715
}
17191716

17201717
if let Some(version) = &self.version {

tests/testsuite/bad_config.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,10 +796,14 @@ fn empty_dependencies() {
796796
Package::new("bar", "0.0.1").publish();
797797

798798
p.cargo("build")
799-
.with_stderr_contains(
799+
.with_status(101)
800+
.with_stderr(
800801
"\
801-
warning: dependency (bar) specified without providing a local path, Git repository, or version \
802-
to use. This will be considered an error in future versions
802+
[ERROR] failed to parse manifest at `[..]`
803+
804+
Caused by:
805+
dependency (bar) specified without providing a local path, Git repository, or version \
806+
to use.
803807
",
804808
)
805809
.run();

0 commit comments

Comments
 (0)