-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10701 - danilhendrasr:master, r=weihanglo
Emit warning upon encountering multiple packages with the same name Fixes: #10669
- Loading branch information
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters