@@ -421,10 +421,7 @@ fn custom_build_env_var_rustc_linker_host_target() {
421
421
422
422
// no crate type set => linker never called => build succeeds if and
423
423
// only if build.rs succeeds, despite linker binary not existing.
424
- p. cargo ( "build -Z target-applies-to-host --target" )
425
- . arg ( & target)
426
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
427
- . run ( ) ;
424
+ p. cargo ( "build --target" ) . arg ( & target) . run ( ) ;
428
425
}
429
426
430
427
#[ cargo_test]
@@ -456,10 +453,9 @@ fn custom_build_env_var_rustc_linker_host_target_env() {
456
453
457
454
// no crate type set => linker never called => build succeeds if and
458
455
// only if build.rs succeeds, despite linker binary not existing.
459
- p. cargo ( "build -Z target-applies-to-host - -target" )
456
+ p. cargo ( "build --target" )
460
457
. env ( "CARGO_TARGET_APPLIES_TO_HOST" , "false" )
461
458
. arg ( & target)
462
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
463
459
. run ( ) ;
464
460
}
465
461
@@ -481,16 +477,10 @@ fn custom_build_invalid_host_config_feature_flag() {
481
477
. file ( "src/lib.rs" , "" )
482
478
. build ( ) ;
483
479
484
- // build.rs should fail due to -Zhost-config being set without -Ztarget-applies-to-host
480
+ // build.rs should not fail due to -Zhost-config being set
485
481
p. cargo ( "build -Z host-config --target" )
486
482
. arg ( & target)
487
483
. masquerade_as_nightly_cargo ( & [ "host-config" ] )
488
- . with_status ( 101 )
489
- . with_stderr_contains (
490
- "\
491
- error: the -Zhost-config flag requires the -Ztarget-applies-to-host flag to be set
492
- " ,
493
- )
494
484
. run ( ) ;
495
485
}
496
486
@@ -515,9 +505,9 @@ fn custom_build_linker_host_target_with_bad_host_config() {
515
505
. build ( ) ;
516
506
517
507
// build.rs should fail due to bad host linker being set
518
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
508
+ p. cargo ( "build -Z host-config --verbose --target" )
519
509
. arg ( & target)
520
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
510
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
521
511
. with_status ( 101 )
522
512
. with_stderr_contains (
523
513
"\
@@ -550,9 +540,9 @@ fn custom_build_linker_bad_host() {
550
540
. build ( ) ;
551
541
552
542
// build.rs should fail due to bad host linker being set
553
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
543
+ p. cargo ( "build -Z host-config --verbose --target" )
554
544
. arg ( & target)
555
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
545
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
556
546
. with_status ( 101 )
557
547
. with_stderr_contains (
558
548
"\
@@ -587,9 +577,9 @@ fn custom_build_linker_bad_host_with_arch() {
587
577
. build ( ) ;
588
578
589
579
// build.rs should fail due to bad host linker being set
590
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
580
+ p. cargo ( "build -Z host-config --verbose --target" )
591
581
. arg ( & target)
592
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
582
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
593
583
. with_status ( 101 )
594
584
. with_stderr_contains (
595
585
"\
@@ -633,9 +623,9 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
633
623
634
624
// build.rs should be built fine since cross target != host target.
635
625
// assertion should succeed since it's still passed the target linker
636
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
626
+ p. cargo ( "build -Z host-config --verbose --target" )
637
627
. arg ( & target)
638
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
628
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
639
629
. run ( ) ;
640
630
}
641
631
@@ -663,9 +653,9 @@ fn custom_build_linker_bad_cross_arch_host() {
663
653
. build ( ) ;
664
654
665
655
// build.rs should fail due to bad host linker being set
666
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
656
+ p. cargo ( "build -Z host-config --verbose --target" )
667
657
. arg ( & target)
668
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
658
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
669
659
. with_status ( 101 )
670
660
. with_stderr_contains (
671
661
"\
0 commit comments