@@ -472,16 +472,14 @@ fn thin_lto_works() {
472
472
#[ cargo_test]
473
473
fn strip_works ( ) {
474
474
if !is_nightly ( ) {
475
- // -Zstrip is unstable
475
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
476
476
return ;
477
477
}
478
478
479
479
let p = project ( )
480
480
. file (
481
481
"Cargo.toml" ,
482
482
r#"
483
- cargo-features = ["strip"]
484
-
485
483
[package]
486
484
name = "foo"
487
485
version = "0.1.0"
@@ -494,73 +492,27 @@ fn strip_works() {
494
492
. build ( ) ;
495
493
496
494
p. cargo ( "build --release -v" )
497
- . masquerade_as_nightly_cargo ( )
498
495
. with_stderr (
499
496
"\
500
497
[COMPILING] foo [..]
501
- [RUNNING] `rustc [..] -Z strip=symbols [..]`
498
+ [RUNNING] `rustc [..] -C strip=symbols [..]`
502
499
[FINISHED] [..]
503
500
" ,
504
501
)
505
502
. run ( ) ;
506
503
}
507
504
508
- #[ cargo_test]
509
- fn strip_requires_cargo_feature ( ) {
510
- if !is_nightly ( ) {
511
- // -Zstrip is unstable
512
- return ;
513
- }
514
-
515
- let p = project ( )
516
- . file (
517
- "Cargo.toml" ,
518
- r#"
519
- [package]
520
- name = "foo"
521
- version = "0.1.0"
522
-
523
- [profile.release]
524
- strip = 'symbols'
525
- "# ,
526
- )
527
- . file ( "src/main.rs" , "fn main() {}" )
528
- . build ( ) ;
529
-
530
- p. cargo ( "build --release -v" )
531
- . masquerade_as_nightly_cargo ( )
532
- . with_status ( 101 )
533
- . with_stderr (
534
- "\
535
- [ERROR] failed to parse manifest at `[CWD]/Cargo.toml`
536
-
537
- Caused by:
538
- feature `strip` is required
539
-
540
- The package requires the Cargo feature called `strip`, but that feature is \
541
- not stabilized in this version of Cargo (1.[..]).
542
- Consider adding `cargo-features = [\" strip\" ]` to the top of Cargo.toml \
543
- (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
544
- See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-strip-option \
545
- for more information about the status of this feature.
546
- " ,
547
- )
548
- . run ( ) ;
549
- }
550
-
551
505
#[ cargo_test]
552
506
fn strip_passes_unknown_option_to_rustc ( ) {
553
507
if !is_nightly ( ) {
554
- // -Zstrip is unstable
508
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
555
509
return ;
556
510
}
557
511
558
512
let p = project ( )
559
513
. file (
560
514
"Cargo.toml" ,
561
515
r#"
562
- cargo-features = ["strip"]
563
-
564
516
[package]
565
517
name = "foo"
566
518
version = "0.1.0"
@@ -573,13 +525,12 @@ fn strip_passes_unknown_option_to_rustc() {
573
525
. build ( ) ;
574
526
575
527
p. cargo ( "build --release -v" )
576
- . masquerade_as_nightly_cargo ( )
577
528
. with_status ( 101 )
578
529
. with_stderr_contains (
579
530
"\
580
531
[COMPILING] foo [..]
581
- [RUNNING] `rustc [..] -Z strip=unknown [..]`
582
- error: incorrect value `unknown` for debugging option `strip` - either `none`, `debuginfo`, or `symbols` was expected
532
+ [RUNNING] `rustc [..] -C strip=unknown [..]`
533
+ error: incorrect value `unknown` for [..] `strip` [..] was expected
583
534
" ,
584
535
)
585
536
. run ( ) ;
@@ -588,16 +539,14 @@ error: incorrect value `unknown` for debugging option `strip` - either `none`, `
588
539
#[ cargo_test]
589
540
fn strip_accepts_true_to_strip_symbols ( ) {
590
541
if !is_nightly ( ) {
591
- // -Zstrip is unstable
542
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
592
543
return ;
593
544
}
594
545
595
546
let p = project ( )
596
547
. file (
597
548
"Cargo.toml" ,
598
549
r#"
599
- cargo-features = ["strip"]
600
-
601
550
[package]
602
551
name = "foo"
603
552
version = "0.1.0"
@@ -610,11 +559,10 @@ fn strip_accepts_true_to_strip_symbols() {
610
559
. build ( ) ;
611
560
612
561
p. cargo ( "build --release -v" )
613
- . masquerade_as_nightly_cargo ( )
614
562
. with_stderr (
615
563
"\
616
564
[COMPILING] foo [..]
617
- [RUNNING] `rustc [..] -Z strip=symbols [..]`
565
+ [RUNNING] `rustc [..] -C strip=symbols [..]`
618
566
[FINISHED] [..]
619
567
" ,
620
568
)
@@ -624,15 +572,14 @@ fn strip_accepts_true_to_strip_symbols() {
624
572
#[ cargo_test]
625
573
fn strip_accepts_false_to_disable_strip ( ) {
626
574
if !is_nightly ( ) {
627
- // -Zstrip is unstable
575
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
628
576
return ;
629
577
}
578
+
630
579
let p = project ( )
631
580
. file (
632
581
"Cargo.toml" ,
633
582
r#"
634
- cargo-features = ["strip"]
635
-
636
583
[package]
637
584
name = "foo"
638
585
version = "0.1.0"
@@ -645,7 +592,6 @@ fn strip_accepts_false_to_disable_strip() {
645
592
. build ( ) ;
646
593
647
594
p. cargo ( "build --release -v" )
648
- . masquerade_as_nightly_cargo ( )
649
- . with_stderr_does_not_contain ( "-Z strip" )
595
+ . with_stderr_does_not_contain ( "-C strip" )
650
596
. run ( ) ;
651
597
}
0 commit comments