Skip to content

Commit

Permalink
Add test verifying behavior in rust-lang#10744
Browse files Browse the repository at this point in the history
  • Loading branch information
gmorenz committed Jul 1, 2024
1 parent c1fe2bd commit 741cf19
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testsuite/rustflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,3 +1587,20 @@ fn host_config_rustflags_with_target() {
.arg("host.rustflags=[\"--cfg=foo\"]")
.run();
}

#[cargo_test]
fn target_applies_to_host_rustflags_works() {
// Ensures that rustflags are passed to the target when
// target_applies_to_host=false
let p = project().file("src/lib.rs", "").build();

// Use RUSTFLAGS to pass an argument that would generate an error
// but it is ignored.
p.cargo("check")
.masquerade_as_nightly_cargo(&["target-applies-to-host"])
.arg("-Ztarget-applies-to-host")
.env("CARGO_TARGET_APPLIES_TO_HOST", "false")
.env("RUSTFLAGS", "-Z bogus")
.with_status(0)
.run();
}

0 comments on commit 741cf19

Please sign in to comment.