@@ -514,10 +514,7 @@ fn custom_build_env_var_rustc_linker_host_target() {
514
514
515
515
// no crate type set => linker never called => build succeeds if and
516
516
// only if build.rs succeeds, despite linker binary not existing.
517
- p. cargo ( "build -Z target-applies-to-host --target" )
518
- . arg ( & target)
519
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
520
- . run ( ) ;
517
+ p. cargo ( "build --target" ) . arg ( & target) . run ( ) ;
521
518
}
522
519
523
520
#[ cargo_test]
@@ -549,10 +546,9 @@ fn custom_build_env_var_rustc_linker_host_target_env() {
549
546
550
547
// no crate type set => linker never called => build succeeds if and
551
548
// only if build.rs succeeds, despite linker binary not existing.
552
- p. cargo ( "build -Z target-applies-to-host - -target" )
549
+ p. cargo ( "build --target" )
553
550
. env ( "CARGO_TARGET_APPLIES_TO_HOST" , "false" )
554
551
. arg ( & target)
555
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
556
552
. run ( ) ;
557
553
}
558
554
@@ -574,16 +570,10 @@ fn custom_build_invalid_host_config_feature_flag() {
574
570
. file ( "src/lib.rs" , "" )
575
571
. build ( ) ;
576
572
577
- // build.rs should fail due to -Zhost-config being set without -Ztarget-applies-to-host
573
+ // build.rs should not fail due to -Zhost-config being set
578
574
p. cargo ( "build -Z host-config --target" )
579
575
. arg ( & target)
580
576
. masquerade_as_nightly_cargo ( & [ "host-config" ] )
581
- . with_status ( 101 )
582
- . with_stderr_contains (
583
- "\
584
- error: the -Zhost-config flag requires the -Ztarget-applies-to-host flag to be set
585
- " ,
586
- )
587
577
. run ( ) ;
588
578
}
589
579
@@ -608,9 +598,9 @@ fn custom_build_linker_host_target_with_bad_host_config() {
608
598
. build ( ) ;
609
599
610
600
// build.rs should fail due to bad host linker being set
611
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
601
+ p. cargo ( "build -Z host-config --verbose --target" )
612
602
. arg ( & target)
613
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
603
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
614
604
. with_status ( 101 )
615
605
. with_stderr_contains (
616
606
"\
@@ -643,9 +633,9 @@ fn custom_build_linker_bad_host() {
643
633
. build ( ) ;
644
634
645
635
// build.rs should fail due to bad host linker being set
646
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
636
+ p. cargo ( "build -Z host-config --verbose --target" )
647
637
. arg ( & target)
648
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
638
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
649
639
. with_status ( 101 )
650
640
. with_stderr_contains (
651
641
"\
@@ -680,9 +670,9 @@ fn custom_build_linker_bad_host_with_arch() {
680
670
. build ( ) ;
681
671
682
672
// build.rs should fail due to bad host linker being set
683
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
673
+ p. cargo ( "build -Z host-config --verbose --target" )
684
674
. arg ( & target)
685
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
675
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
686
676
. with_status ( 101 )
687
677
. with_stderr_contains (
688
678
"\
@@ -726,9 +716,9 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
726
716
727
717
// build.rs should be built fine since cross target != host target.
728
718
// assertion should succeed since it's still passed the target linker
729
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
719
+ p. cargo ( "build -Z host-config --verbose --target" )
730
720
. arg ( & target)
731
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
721
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
732
722
. run ( ) ;
733
723
}
734
724
@@ -756,9 +746,9 @@ fn custom_build_linker_bad_cross_arch_host() {
756
746
. build ( ) ;
757
747
758
748
// build.rs should fail due to bad host linker being set
759
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
749
+ p. cargo ( "build -Z host-config --verbose --target" )
760
750
. arg ( & target)
761
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
751
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
762
752
. with_status ( 101 )
763
753
. with_stderr_contains (
764
754
"\
0 commit comments