@@ -402,10 +402,7 @@ fn custom_build_env_var_rustc_linker_host_target() {
402
402
403
403
// no crate type set => linker never called => build succeeds if and
404
404
// only if build.rs succeeds, despite linker binary not existing.
405
- p. cargo ( "build -Z target-applies-to-host --target" )
406
- . arg ( & target)
407
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
408
- . run ( ) ;
405
+ p. cargo ( "build --target" ) . arg ( & target) . run ( ) ;
409
406
}
410
407
411
408
#[ cargo_test]
@@ -437,10 +434,9 @@ fn custom_build_env_var_rustc_linker_host_target_env() {
437
434
438
435
// no crate type set => linker never called => build succeeds if and
439
436
// only if build.rs succeeds, despite linker binary not existing.
440
- p. cargo ( "build -Z target-applies-to-host - -target" )
437
+ p. cargo ( "build --target" )
441
438
. env ( "CARGO_TARGET_APPLIES_TO_HOST" , "false" )
442
439
. arg ( & target)
443
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
444
440
. run ( ) ;
445
441
}
446
442
@@ -462,16 +458,10 @@ fn custom_build_invalid_host_config_feature_flag() {
462
458
. file ( "src/lib.rs" , "" )
463
459
. build ( ) ;
464
460
465
- // build.rs should fail due to -Zhost-config being set without -Ztarget-applies-to-host
461
+ // build.rs should not fail due to -Zhost-config being set
466
462
p. cargo ( "build -Z host-config --target" )
467
463
. arg ( & target)
468
464
. masquerade_as_nightly_cargo ( & [ "host-config" ] )
469
- . with_status ( 101 )
470
- . with_stderr_contains (
471
- "\
472
- error: the -Zhost-config flag requires the -Ztarget-applies-to-host flag to be set
473
- " ,
474
- )
475
465
. run ( ) ;
476
466
}
477
467
@@ -496,9 +486,9 @@ fn custom_build_linker_host_target_with_bad_host_config() {
496
486
. build ( ) ;
497
487
498
488
// build.rs should fail due to bad host linker being set
499
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
489
+ p. cargo ( "build -Z host-config --verbose --target" )
500
490
. arg ( & target)
501
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
491
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
502
492
. with_status ( 101 )
503
493
. with_stderr_contains (
504
494
"\
@@ -531,9 +521,9 @@ fn custom_build_linker_bad_host() {
531
521
. build ( ) ;
532
522
533
523
// build.rs should fail due to bad host linker being set
534
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
524
+ p. cargo ( "build -Z host-config --verbose --target" )
535
525
. arg ( & target)
536
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
526
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
537
527
. with_status ( 101 )
538
528
. with_stderr_contains (
539
529
"\
@@ -568,9 +558,9 @@ fn custom_build_linker_bad_host_with_arch() {
568
558
. build ( ) ;
569
559
570
560
// build.rs should fail due to bad host linker being set
571
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
561
+ p. cargo ( "build -Z host-config --verbose --target" )
572
562
. arg ( & target)
573
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
563
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
574
564
. with_status ( 101 )
575
565
. with_stderr_contains (
576
566
"\
@@ -614,9 +604,9 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
614
604
615
605
// build.rs should be built fine since cross target != host target.
616
606
// assertion should succeed since it's still passed the target linker
617
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
607
+ p. cargo ( "build -Z host-config --verbose --target" )
618
608
. arg ( & target)
619
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
609
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
620
610
. run ( ) ;
621
611
}
622
612
@@ -644,9 +634,9 @@ fn custom_build_linker_bad_cross_arch_host() {
644
634
. build ( ) ;
645
635
646
636
// build.rs should fail due to bad host linker being set
647
- p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
637
+ p. cargo ( "build -Z host-config --verbose --target" )
648
638
. arg ( & target)
649
- . masquerade_as_nightly_cargo ( & [ "target-applies-to-host" , " host-config"] )
639
+ . masquerade_as_nightly_cargo ( & [ "host-config" ] )
650
640
. with_status ( 101 )
651
641
. with_stderr_contains (
652
642
"\
0 commit comments