Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cargo/ops/cargo_read_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ fn read_nested_packages(
v.insert(pkg);
}
Entry::Occupied(_) => {
info!(
"skipping nested package `{}` found at `{}`",
let _ = config.shell().warn(format!(
"skipping duplicate package `{}` found at `{}`",
pkg.name(),
path.to_string_lossy()
);
));
}
}

Expand Down
46 changes: 46 additions & 0 deletions tests/testsuite/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,52 @@ Caused by:
.run();
}

#[cargo_test]
fn dep_ambiguous() {
let project = project();
let git_project = git::new("dep", |project| {
project
.file("aaa/Cargo.toml", &basic_manifest("bar", "0.5.0"))
.file("aaa/src/lib.rs", "")
.file("bbb/Cargo.toml", &basic_manifest("bar", "0.5.0"))
.file("bbb/src/lib.rs", "")
.file("ccc/Cargo.toml", &basic_manifest("bar", "0.5.0"))
.file("ccc/src/lib.rs", "")
});

let p = project
.file(
"Cargo.toml",
&format!(
r#"
[project]

name = "foo"
version = "0.5.0"
authors = ["[email protected]"]

[dependencies.bar]
git = '{}'
"#,
git_project.url()
),
)
.file("src/main.rs", "fn main() { }")
.build();

p.cargo("build").run();
p.cargo("run")
.with_stderr(
"\
[WARNING] skipping duplicate package `bar` found at `[..]`
[WARNING] skipping duplicate package `bar` found at `[..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[RUNNING] `target/debug/foo[EXE]`
",
)
.run();
}

#[cargo_test]
fn two_deps_only_update_one() {
let project = project();
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ fn override_and_depend() {
.cwd("b")
.with_stderr(
"\
[WARNING] skipping duplicate package `a2` found at `[..]`
[COMPILING] a2 v0.5.0 ([..])
[COMPILING] a1 v0.5.0 ([..])
[COMPILING] b v0.5.0 ([..])
Expand Down