Skip to content

Commit

Permalink
Avoid depending on output of rustc
Browse files Browse the repository at this point in the history
There is cyclic dependency between rustc and cargo which makes it
impossible to adjust cargo's expectations on rustc without leaving
broken commits in rustc and cargo.
  • Loading branch information
Byron committed Feb 18, 2022
1 parent 3de5799 commit 78213ea
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/testsuite/artifact_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn features_are_not_unified_among_lib_and_bin_dep_of_different_target() {
"d1/src/lib.rs",
r#"
#[cfg(feature = "d2")]
extern crate d2;
pub extern crate d2;
"#,
)
.file(
Expand Down Expand Up @@ -564,18 +564,15 @@ fn build_script_with_bin_artifact_and_lib_false() {
"bar/src/lib.rs",
r#"
pub fn doit() {
panic!("cannot be called from build script due to lib = false");
panic!("sentinel");
}
"#,
)
.build();
p.cargo("build -Z bindeps")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr_contains(
"error[E0433]: failed to resolve: use of undeclared crate or module `bar`",
)
.with_stderr_contains(" --> build.rs:3:16")
.with_stderr_does_not_contain("[..]sentinel[..]")
.run();
}

Expand All @@ -598,7 +595,7 @@ fn lib_with_bin_artifact_and_lib_false() {
.file(
"src/lib.rs",
r#"
fn foo() {
pub fn foo() {
bar::doit()
}"#,
)
Expand All @@ -608,18 +605,15 @@ fn lib_with_bin_artifact_and_lib_false() {
"bar/src/lib.rs",
r#"
pub fn doit() {
panic!("cannot be called from library due to lib = false");
panic!("sentinel");
}
"#,
)
.build();
p.cargo("build -Z bindeps")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr_contains(
"error[E0433]: failed to resolve: use of undeclared crate or module `bar`",
)
.with_stderr_contains(" --> src/lib.rs:3:16")
.with_stderr_does_not_contain("[..]sentinel[..]")
.run();
}

Expand Down

0 comments on commit 78213ea

Please sign in to comment.