Skip to content

Commit d4e504c

Browse files
authored
Revert "When a dependency does not have a version, git or path, fails directly"
1 parent 72ef2bd commit d4e504c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,11 +1762,14 @@ impl<P: ResolveToPath> DetailedTomlDependency<P> {
17621762
kind: Option<DepKind>,
17631763
) -> CargoResult<Dependency> {
17641764
if self.version.is_none() && self.path.is_none() && self.git.is_none() {
1765-
bail!(
1765+
let msg = format!(
17661766
"dependency ({}) specified without \
1767-
providing a local path, Git repository, or version to use.",
1767+
providing a local path, Git repository, or \
1768+
version to use. This will be considered an \
1769+
error in future versions",
17681770
name_in_toml
17691771
);
1772+
cx.warnings.push(msg);
17701773
}
17711774

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

tests/testsuite/bad_config.rs

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

765765
p.cargo("build")
766-
.with_status(101)
767-
.with_stderr(
766+
.with_stderr_contains(
768767
"\
769-
[ERROR] failed to parse manifest at `[..]`
770-
771-
Caused by:
772-
dependency (bar) specified without providing a local path, Git repository, or version \
773-
to use.
768+
warning: dependency (bar) specified without providing a local path, Git repository, or version \
769+
to use. This will be considered an error in future versions
774770
",
775771
)
776772
.run();

0 commit comments

Comments
 (0)