From 8f3be5dbeb6a2faa17c4f733a514ba0deededb8d Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 14 Sep 2021 13:05:44 -0700 Subject: [PATCH] [beta] Revert "When a dependency does not have a version, git or path, fails directly" This reverts commit 98d5d10268684d337d70caa2b0b95cc4c13b34f9, reversing changes made to 3658906b0700ec70c727d95f5cdecc7c61a95a82. Reverting #9686 --- src/cargo/util/toml/mod.rs | 7 +++++-- tests/testsuite/bad_config.rs | 10 +++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 059c4480377..019dc346dd5 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -1762,11 +1762,14 @@ impl DetailedTomlDependency

{ kind: Option, ) -> CargoResult { if self.version.is_none() && self.path.is_none() && self.git.is_none() { - bail!( + let msg = format!( "dependency ({}) specified without \ - providing a local path, Git repository, or version to use.", + providing a local path, Git repository, or \ + version to use. This will be considered an \ + error in future versions", name_in_toml ); + cx.warnings.push(msg); } if let Some(version) = &self.version { diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index e5e1775ad85..330a0c5829a 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -763,14 +763,10 @@ fn empty_dependencies() { Package::new("bar", "0.0.1").publish(); p.cargo("build") - .with_status(101) - .with_stderr( + .with_stderr_contains( "\ -[ERROR] failed to parse manifest at `[..]` - -Caused by: - dependency (bar) specified without providing a local path, Git repository, or version \ -to use. +warning: dependency (bar) specified without providing a local path, Git repository, or version \ +to use. This will be considered an error in future versions ", ) .run();