@@ -136,7 +136,7 @@ fn package_feature_unification() {
136
136
".cargo/config.toml" ,
137
137
r#"
138
138
[resolver]
139
- feature-unification = "selected "
139
+ feature-unification = "package "
140
140
"# ,
141
141
)
142
142
. file (
@@ -245,14 +245,21 @@ fn package_feature_unification() {
245
245
p. cargo ( "check -p a -p b" )
246
246
. arg ( "-Zfeature-unification" )
247
247
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
248
- . with_status ( 101 )
249
- . with_stderr_contains ( "[ERROR] features were unified" )
248
+ . with_stderr_data (
249
+ str![ [ r#"
250
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
251
+
252
+ "# ] ]
253
+ . unordered ( ) ,
254
+ )
250
255
. run ( ) ;
251
256
p. cargo ( "check" )
252
257
. arg ( "-Zfeature-unification" )
253
258
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
254
- . with_status ( 101 )
255
- . with_stderr_contains ( "[ERROR] features were unified" )
259
+ . with_stderr_data ( str![ [ r#"
260
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
261
+
262
+ "# ] ] )
256
263
. run ( ) ;
257
264
// Sanity check that compilation without package feature unification does not work
258
265
p. cargo ( "check -p a -p b" )
@@ -271,7 +278,7 @@ fn package_feature_unification_default_features() {
271
278
".cargo/config.toml" ,
272
279
r#"
273
280
[resolver]
274
- feature-unification = "selected "
281
+ feature-unification = "package "
275
282
"# ,
276
283
)
277
284
. file (
@@ -366,17 +373,9 @@ fn package_feature_unification_default_features() {
366
373
p. cargo ( "check" )
367
374
. arg ( "-Zfeature-unification" )
368
375
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
369
- . with_status ( 101 )
370
376
. with_stderr_data (
371
377
str![ [ r#"
372
- [CHECKING] common v0.1.0 ([ROOT]/foo/common)
373
- [ERROR] features were unified
374
- --> common/src/lib.rs:3:17
375
- |
376
- 3 | compile_error!("features were unified");
377
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
378
-
379
- [ERROR] could not compile `common` (lib) due to 1 previous error
378
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
380
379
381
380
"# ] ]
382
381
. unordered ( ) ,
@@ -407,7 +406,7 @@ fn package_feature_unification_cli_features() {
407
406
".cargo/config.toml" ,
408
407
r#"
409
408
[resolver]
410
- feature-unification = "selected "
409
+ feature-unification = "package "
411
410
"# ,
412
411
)
413
412
. file (
@@ -481,30 +480,17 @@ fn package_feature_unification_cli_features() {
481
480
p. cargo ( "check -p a -p b -F a,b" )
482
481
. arg ( "-Zfeature-unification" )
483
482
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
484
- . with_status ( 101 )
485
483
. with_stderr_data (
486
484
str![ [ r#"
485
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
487
486
[CHECKING] common v0.1.0 ([ROOT]/foo/common)
488
- [ERROR] features were unified
489
- --> common/src/lib.rs:3:17
490
- |
491
- 3 | compile_error!("features were unified");
492
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
493
-
494
- [ERROR] could not compile `common` (lib) due to 1 previous error
495
487
[UPDATING] `dummy-registry` index
496
488
[LOCKING] 1 package to latest compatible version
497
489
[DOWNLOADING] crates ...
498
490
[DOWNLOADED] outside v0.1.0 (registry `dummy-registry`)
499
491
[CHECKING] outside v0.1.0
500
- [ERROR] features were unified
501
- --> [ROOT]/home/.cargo/registry/src/-[HASH]/outside-0.1.0/src/lib.rs:3:17
502
- |
503
- 3 | compile_error!("features were unified");
504
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
505
-
506
- [ERROR] could not compile `outside` (lib) due to 1 previous error
507
- [WARNING] build failed, waiting for other jobs to finish...
492
+ [CHECKING] b v0.1.0 ([ROOT]/foo/b)
493
+ [CHECKING] a v0.1.0 ([ROOT]/foo/a)
508
494
509
495
"# ] ]
510
496
. unordered ( ) ,
@@ -513,26 +499,9 @@ fn package_feature_unification_cli_features() {
513
499
p. cargo ( "check --workspace --exclude common -F a,b" )
514
500
. arg ( "-Zfeature-unification" )
515
501
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
516
- . with_status ( 101 )
517
502
. with_stderr_data (
518
503
str![ [ r#"
519
- [CHECKING] outside v0.1.0
520
- [CHECKING] common v0.1.0 ([ROOT]/foo/common)
521
- [ERROR] features were unified
522
- --> common/src/lib.rs:3:17
523
- |
524
- 3 | compile_error!("features were unified");
525
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
526
-
527
- [ERROR] features were unified
528
- --> [ROOT]/home/.cargo/registry/src/-[HASH]/outside-0.1.0/src/lib.rs:3:17
529
- |
530
- 3 | compile_error!("features were unified");
531
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
532
-
533
- [ERROR] could not compile `outside` (lib) due to 1 previous error
534
- [WARNING] build failed, waiting for other jobs to finish...
535
- [ERROR] could not compile `common` (lib) due to 1 previous error
504
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
536
505
537
506
"# ] ]
538
507
. unordered ( ) ,
@@ -542,26 +511,9 @@ fn package_feature_unification_cli_features() {
542
511
p. cargo ( "check -p a -p b -F a/a,b/b" )
543
512
. arg ( "-Zfeature-unification" )
544
513
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
545
- . with_status ( 101 )
546
514
. with_stderr_data (
547
515
str![ [ r#"
548
- [CHECKING] outside v0.1.0
549
- [CHECKING] common v0.1.0 ([ROOT]/foo/common)
550
- [ERROR] features were unified
551
- --> common/src/lib.rs:3:17
552
- |
553
- 3 | compile_error!("features were unified");
554
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
555
-
556
- [ERROR] features were unified
557
- --> [ROOT]/home/.cargo/registry/src/-[HASH]/outside-0.1.0/src/lib.rs:3:17
558
- |
559
- 3 | compile_error!("features were unified");
560
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
561
-
562
- [ERROR] could not compile `common` (lib) due to 1 previous error
563
- [WARNING] build failed, waiting for other jobs to finish...
564
- [ERROR] could not compile `outside` (lib) due to 1 previous error
516
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
565
517
566
518
"# ] ]
567
519
. unordered ( ) ,
@@ -618,7 +570,7 @@ fn package_feature_unification_weak_dependencies() {
618
570
".cargo/config.toml" ,
619
571
r#"
620
572
[resolver]
621
- feature-unification = "selected "
573
+ feature-unification = "package "
622
574
"# ,
623
575
)
624
576
. file (
@@ -690,17 +642,12 @@ fn package_feature_unification_weak_dependencies() {
690
642
p. cargo ( "check -p a -p b" )
691
643
. arg ( "-Zfeature-unification" )
692
644
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
693
- . with_status ( 101 )
694
645
. with_stderr_data (
695
646
str![ [ r#"
696
647
[CHECKING] common v0.1.0 ([ROOT]/foo/common)
697
- [ERROR] features were unified
698
- --> common/src/lib.rs:3:17
699
- |
700
- 3 | compile_error!("features were unified");
701
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
702
-
703
- [ERROR] could not compile `common` (lib) due to 1 previous error
648
+ [CHECKING] a v0.1.0 ([ROOT]/foo/a)
649
+ [CHECKING] b v0.1.0 ([ROOT]/foo/b)
650
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
704
651
705
652
"# ] ]
706
653
. unordered ( ) ,
@@ -709,16 +656,9 @@ fn package_feature_unification_weak_dependencies() {
709
656
p. cargo ( "check" )
710
657
. arg ( "-Zfeature-unification" )
711
658
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
712
- . with_status ( 101 )
713
659
. with_stderr_data ( str![ [ r#"
714
660
[CHECKING] common v0.1.0 ([ROOT]/foo/common)
715
- [ERROR] features were unified
716
- --> common/src/lib.rs:3:17
717
- |
718
- 3 | compile_error!("features were unified");
719
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
720
-
721
- [ERROR] could not compile `common` (lib) due to 1 previous error
661
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
722
662
723
663
"# ] ] )
724
664
. run ( ) ;
@@ -873,27 +813,27 @@ common v0.1.0 ([ROOT]/foo/common)
873
813
p. cargo ( "tree -e features" )
874
814
. arg ( "-Zfeature-unification" )
875
815
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
876
- . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "selected" ) // To be changed to package later
816
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
877
817
. with_stdout_data ( str![ [ r#"
818
+ common v0.1.0 ([ROOT]/foo/common)
878
819
a v0.1.0 ([ROOT]/foo/a)
879
820
├── common feature "a"
880
821
│ └── common v0.1.0 ([ROOT]/foo/common)
881
- ├── common feature "default" (command-line)
822
+ ├── common feature "default"
882
823
│ └── common v0.1.0 ([ROOT]/foo/common)
883
824
├── outside feature "a"
884
825
│ └── outside v0.1.0
885
826
└── outside feature "default"
886
827
└── outside v0.1.0
887
-
888
828
b v0.1.0 ([ROOT]/foo/b)
889
829
├── common feature "b"
890
830
│ └── common v0.1.0 ([ROOT]/foo/common)
891
- ├── common feature "default" (command-line) (*)
831
+ ├── common feature "default"
832
+ │ └── common v0.1.0 ([ROOT]/foo/common)
892
833
├── outside feature "b"
893
834
│ └── outside v0.1.0
894
- └── outside feature "default" (*)
895
-
896
- common v0.1.0 ([ROOT]/foo/common)
835
+ └── outside feature "default"
836
+ └── outside v0.1.0
897
837
898
838
"# ] ] )
899
839
. run ( ) ;
@@ -973,7 +913,7 @@ fn cargo_install_ignores_config() {
973
913
. arg ( p. root ( ) )
974
914
. arg ( "-Zfeature-unification" )
975
915
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
976
- . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "selected " )
916
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package " )
977
917
. with_stderr_data ( str![ [ r#"
978
918
[INSTALLING] a v0.1.0 ([ROOT]/foo)
979
919
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
@@ -1029,7 +969,7 @@ edition = "2021"
1029
969
. build ( ) ;
1030
970
1031
971
p. cargo ( "fix --edition --allow-no-vcs" )
1032
- . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "selected " )
972
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package " )
1033
973
. arg ( "-Zfeature-unification" )
1034
974
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1035
975
. with_stderr_data ( str![ [ r#"
@@ -1111,10 +1051,10 @@ fn edition_v2_resolver_report() {
1111
1051
. build ( ) ;
1112
1052
1113
1053
p. cargo ( "fix --edition --allow-no-vcs --workspace" )
1114
- . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "selected " )
1054
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package " )
1115
1055
. arg ( "-Zfeature-unification" )
1116
1056
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1117
- . with_status ( 0 )
1057
+ . with_status ( 101 )
1118
1058
. with_stderr_data (
1119
1059
str![ [ r#"
1120
1060
[MIGRATING] Cargo.toml from 2018 edition to 2021
@@ -1125,26 +1065,7 @@ fn edition_v2_resolver_report() {
1125
1065
[DOWNLOADED] bar v1.0.0 (registry `dummy-registry`)
1126
1066
[DOWNLOADED] opt_dep v1.0.0 (registry `dummy-registry`)
1127
1067
[MIGRATING] bar/Cargo.toml from 2018 edition to 2021
1128
- [NOTE] Switching to Edition 2021 will enable the use of the version 2 feature resolver in Cargo.
1129
- This may cause some dependencies to be built with fewer features enabled than previously.
1130
- More information about the resolver changes may be found at https://doc.rust-lang.org/nightly/edition-guide/rust-2021/default-cargo-resolver.html
1131
- When building the following dependencies, the given features will no longer be used:
1132
-
1133
- common v1.0.0 removed features: dev-feat, f1, opt_dep
1134
- common v1.0.0 (as host dependency) removed features: dev-feat, f1
1135
-
1136
- The following differences only apply when building with dev-dependencies:
1137
-
1138
- common v1.0.0 removed features: f1, opt_dep
1139
-
1140
- [CHECKING] opt_dep v1.0.0
1141
- [CHECKING] bar v1.0.0
1142
- [CHECKING] bar v0.1.0 ([ROOT]/foo/bar)
1143
- [MIGRATING] bar/src/lib.rs from 2018 edition to 2021
1144
- [CHECKING] common v1.0.0
1145
- [CHECKING] foo v0.1.0 ([ROOT]/foo)
1146
- [MIGRATING] src/lib.rs from 2018 edition to 2021
1147
- [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1068
+ [ERROR] cannot fix edition when using `feature-unification = "package"`.
1148
1069
1149
1070
"# ] ]
1150
1071
. unordered ( ) ,
@@ -1213,7 +1134,7 @@ fn feature_unification_of_cli_features_within_workspace() {
1213
1134
p. cargo ( "check -p parent -F grandchild/a" )
1214
1135
. arg ( "-Zfeature-unification" )
1215
1136
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1216
- // .env("CARGO_RESOLVER_FEATURE_UNIFICATION", "package")
1137
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
1217
1138
. with_status ( 101 )
1218
1139
. with_stderr_data ( str![ [ r#"
1219
1140
[ERROR] the package 'parent' does not contain this feature: grandchild/a
@@ -1246,7 +1167,7 @@ fn feature_unification_of_cli_features_within_workspace() {
1246
1167
p. cargo ( "check -p child -F grandchild/a" )
1247
1168
. arg ( "-Zfeature-unification" )
1248
1169
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1249
- // .env("CARGO_RESOLVER_FEATURE_UNIFICATION", "package")
1170
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
1250
1171
. with_stderr_data ( str![ [ r#"
1251
1172
[CHECKING] grandchild v0.1.0 ([ROOT]/foo/grandchild)
1252
1173
[CHECKING] child v0.1.0 ([ROOT]/foo/child)
@@ -1278,7 +1199,7 @@ fn feature_unification_of_cli_features_within_workspace() {
1278
1199
p. cargo ( "check -F grandchild/a" )
1279
1200
. arg ( "-Zfeature-unification" )
1280
1201
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1281
- // .env("CARGO_RESOLVER_FEATURE_UNIFICATION", "package")
1202
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
1282
1203
. with_stderr_data ( str![ [ r#"
1283
1204
[CHECKING] parent v0.1.0 ([ROOT]/foo/parent)
1284
1205
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -1309,7 +1230,7 @@ fn feature_unification_of_cli_features_within_workspace() {
1309
1230
p. cargo ( "check -F grandchild/a --workspace --exclude grandchild" )
1310
1231
. arg ( "-Zfeature-unification" )
1311
1232
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1312
- // .env("CARGO_RESOLVER_FEATURE_UNIFICATION", "package")
1233
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
1313
1234
. with_stderr_data ( str![ [ r#"
1314
1235
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1315
1236
@@ -1339,7 +1260,7 @@ fn feature_unification_of_cli_features_within_workspace() {
1339
1260
p. cargo ( "check -F grandchild/a --workspace --exclude grandchild --exclude child" )
1340
1261
. arg ( "-Zfeature-unification" )
1341
1262
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
1342
- // .env("CARGO_RESOLVER_FEATURE_UNIFICATION", "package")
1263
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
1343
1264
. with_status ( 101 )
1344
1265
. with_stderr_data ( str![ [ r#"
1345
1266
[ERROR] the package 'parent' does not contain this feature: grandchild/a
0 commit comments