File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1587,3 +1587,20 @@ fn host_config_rustflags_with_target() {
1587
1587
. arg ( "host.rustflags=[\" --cfg=foo\" ]" )
1588
1588
. run ( ) ;
1589
1589
}
1590
+
1591
+ #[ cargo_test]
1592
+ fn target_applies_to_host_rustflags_works ( ) {
1593
+ // Ensures that rustflags are passed to the target when
1594
+ // target_applies_to_host=false
1595
+ let p = project ( ) . file ( "src/lib.rs" , r#"#[cfg(feature = "flag")] compile_error!("flag passed");"# ) . build ( ) ;
1596
+
1597
+ // Use RUSTFLAGS to pass an argument that would generate an error
1598
+ // but it is ignored.
1599
+ p. cargo ( "check" )
1600
+ . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
1601
+ . arg ( "-Ztarget-applies-to-host" )
1602
+ . env ( "CARGO_TARGET_APPLIES_TO_HOST" , "false" )
1603
+ . env ( "RUSTFLAGS" , r#"--cfg feature="flag""# )
1604
+ . with_status ( 0 )
1605
+ . run ( ) ;
1606
+ }
You can’t perform that action at this time.
0 commit comments