Auto merge of #9911 - rust-lang:revert-9686-rustin-patch-error, r=alexcrichton

Revert "When a dependency does not have a version, git or path, fails directly"

Reverts rust-lang/cargo#9686

We discussed, and felt like this change wasn't all that important, and a few people have mentioned that it caused problems for them.

Closes #9885
This commit is contained in:
bors 2021-09-14 20:20:30 +00:00
commit f69305e005
2 changed files with 8 additions and 9 deletions

View file

@ -1762,11 +1762,14 @@ impl<P: ResolveToPath> DetailedTomlDependency<P> {
kind: Option<DepKind>,
) -> CargoResult<Dependency> {
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 {

View file

@ -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();