From f34406f220069e4da08026c4c3b63d5398ce6cc7 Mon Sep 17 00:00:00 2001 From: Peter Wagenet Date: Tue, 8 Nov 2016 13:30:23 -0800 Subject: [PATCH 1/2] Add failing test for #3195 --- tests/cfg.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/cfg.rs b/tests/cfg.rs index 017f0172377..473459bfc19 100644 --- a/tests/cfg.rs +++ b/tests/cfg.rs @@ -244,9 +244,11 @@ fn ignore_version_from_other_platform() { [target.'cfg({})'.dependencies] foo = "0.1.0" + bar = {{ git = "https://github.com/rust-lang/libc", rev = "89ddad83ff8ec43437fdd0fae72cc23e8247208a" }} [target.'cfg({})'.dependencies] foo = "0.2.0" + bar = {{ git = "https://github.com/rust-lang/libc", rev = "b3676593f6930c32d947c59e210789bbfcb30960" }} "#, this_family, other_family)) .file("src/lib.rs", "extern crate foo;"); From bffc636248eb07ec408313e19dd6e220eb6505bc Mon Sep 17 00:00:00 2001 From: Peter Wagenet Date: Tue, 8 Nov 2016 14:53:33 -0800 Subject: [PATCH 2/2] Add another failing test for duplicates --- tests/bad-config.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/bad-config.rs b/tests/bad-config.rs index f4a28e51d90..b3f0babaf40 100644 --- a/tests/bad-config.rs +++ b/tests/bad-config.rs @@ -557,6 +557,35 @@ Caused by: ")); } +#[test] +fn duplicate_deps_2() { + Package::new("bar", "0.1.0").publish(); + Package::new("bar", "0.2.0").publish(); + + let foo = project("foo") + .file("Cargo.toml", r#" + [package] + name = "qqq" + version = "0.0.1" + authors = [] + + [dependencies] + bar = "0.1.0" + + [target.x86_64-unknown-linux-gnu.dependencies] + bar = "0.2.0" + "#) + .file("src/main.rs", r#"fn main () {}"#); + + assert_that(foo.cargo_process("build"), + execs().with_status(101).with_stderr("\ +[ERROR] failed to parse manifest at `[..]` + +Caused by: + found duplicate dependency name bar, but all dependencies must have a unique name +")); +} + #[test] fn unused_keys() { let foo = project("foo")