diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs index 0c0646fe2..7d8cc16ce 100644 --- a/src/cargo/util/toml.rs +++ b/src/cargo/util/toml.rs @@ -656,7 +656,10 @@ impl TomlManifest { TomlDependency::Detailed(d) } TomlDependency::Simple(ref s) => { - TomlDependency::Simple(s.clone()) + TomlDependency::Detailed(DetailedTomlDependency { + version: Some(s.clone()), + ..Default::default() + }) } } } diff --git a/tests/package.rs b/tests/package.rs index 540c66c57..1777235e1 100644 --- a/tests/package.rs +++ b/tests/package.rs @@ -12,6 +12,7 @@ use std::path::{Path, PathBuf}; use cargotest::{cargo_process, process}; use cargotest::support::{project, execs, paths, git, path2url, cargo_exe}; +use cargotest::support::registry::Package; use flate2::read::GzDecoder; use hamcrest::{assert_that, existing_file, contains, equal_to}; use tar::Archive; @@ -663,6 +664,7 @@ fn ignore_workspace_specifier() { [project] name = "foo" version = "0.0.1" + authors = [] [workspace] @@ -714,3 +716,24 @@ version = "0.1.0" authors = [] "#)); } + +#[test] +fn package_two_kinds_of_deps() { + Package::new("other", "1.0.0").publish(); + Package::new("other1", "1.0.0").publish(); + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.0.1" + authors = [] + + [dependencies] + other = "1.0" + other1 = { version = "1.0" } + "#) + .file("src/main.rs", ""); + + assert_that(p.cargo_process("package").arg("--no-verify"), + execs().with_status(0)); +}