Skip to content

Commit d5e43bb

Browse files
committed
added test replicating error encountered with transitive artifact dependencies
1 parent ded1a15 commit d5e43bb

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

tests/testsuite/artifact_dep.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,3 +2856,50 @@ fn same_target_artifact_dep_sharing() {
28562856
)
28572857
.run();
28582858
}
2859+
2860+
#[cargo_test]
2861+
fn check_transitive_artifact_dependency_with_different_target() {
2862+
let p = project()
2863+
.file(
2864+
"Cargo.toml",
2865+
r#"
2866+
[package]
2867+
name = "foo"
2868+
version = "0.0.0"
2869+
2870+
[dependencies]
2871+
bar = { path = "bar/" }
2872+
"#,
2873+
)
2874+
.file("src/lib.rs", "")
2875+
.file(
2876+
"bar/Cargo.toml",
2877+
r#"
2878+
[package]
2879+
name = "bar"
2880+
version = "0.0.0"
2881+
2882+
[dependencies]
2883+
baz = { path = "baz/", artifact = "bin", target = "custom" }
2884+
"#,
2885+
)
2886+
.file("bar/src/lib.rs", "")
2887+
.file(
2888+
"bar/baz/Cargo.toml",
2889+
r#"
2890+
[package]
2891+
name = "baz"
2892+
version = "0.0.0"
2893+
2894+
[dependencies]
2895+
"#,
2896+
)
2897+
.file("bar/baz/src/main.rs", "fn main() {}")
2898+
.build();
2899+
2900+
p.cargo("check -Z bindeps")
2901+
.masquerade_as_nightly_cargo(&["bindeps"])
2902+
.with_stderr_contains(r#"thread 'main' panicked at 'no entry found for key'[..]"#)
2903+
.with_status(101)
2904+
.run();
2905+
}

0 commit comments

Comments
 (0)