Skip to content

Commit fb47df7

Browse files
author
Jon Gjengset
committed
Add regression test for #10206
1 parent 040f0d1 commit fb47df7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/testsuite/rustflags.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,3 +1435,21 @@ fn remap_path_prefix_works() {
14351435
.with_stdout("/foo/home/.cargo/registry/src/[..]/bar-0.1.0/src/lib.rs")
14361436
.run();
14371437
}
1438+
1439+
#[cargo_test]
1440+
fn host_config_rustflags_with_target() {
1441+
// regression test for https://github.com/rust-lang/cargo/issues/10206
1442+
let p = project()
1443+
.file("src/lib.rs", "")
1444+
.file("build.rs.rs", "fn main() { assert!(cfg!(foo)); }")
1445+
.build();
1446+
1447+
p.cargo("build")
1448+
.masquerade_as_nightly_cargo()
1449+
.arg("-Zhost-config")
1450+
.arg("-Ztarget-applies-to-host=no")
1451+
.arg("-Zunstable-options")
1452+
.arg("--config")
1453+
.arg("host.rustflags=[\"--cfg=foo\"]")
1454+
.run();
1455+
}

0 commit comments

Comments
 (0)