Skip to content

Commit eb89c13

Browse files
committed
Auto merge of #9912 - ehuss:beta-revert-9686, r=alexcrichton
[beta] Revert "When a dependency does not have a version, git or path… …, fails directly" This reverts commit 98d5d10, reversing changes made to 3658906. Reverting #9686 Also including #9906 for CI.
2 parents 3a9fd21 + c7b1323 commit eb89c13

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-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();

tests/testsuite/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ Caused by:
656656
);
657657

658658
#[derive(Debug, Deserialize)]
659+
#[allow(dead_code)]
659660
struct S {
660661
f1: i64,
661662
f2: String,
@@ -1155,6 +1156,7 @@ fn table_merge_failure() {
11551156
);
11561157

11571158
#[derive(Debug, Deserialize)]
1159+
#[allow(dead_code)]
11581160
struct Table {
11591161
key: StringList,
11601162
}

0 commit comments

Comments
 (0)