@@ -131,7 +131,7 @@ fn package_feature_unification() {
131
131
".cargo/config.toml" ,
132
132
r#"
133
133
[resolver]
134
- feature-unification = "selected "
134
+ feature-unification = "package "
135
135
"# ,
136
136
)
137
137
. file (
@@ -240,14 +240,21 @@ fn package_feature_unification() {
240
240
p. cargo ( "check -p a -p b" )
241
241
. arg ( "-Zfeature-unification" )
242
242
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
243
- . with_status ( 101 )
244
- . with_stderr_contains ( "[ERROR] features were unified" )
243
+ . with_stderr_data (
244
+ str![ [ r#"
245
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
246
+
247
+ "# ] ]
248
+ . unordered ( ) ,
249
+ )
245
250
. run ( ) ;
246
251
p. cargo ( "check" )
247
252
. arg ( "-Zfeature-unification" )
248
253
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
249
- . with_status ( 101 )
250
- . with_stderr_contains ( "[ERROR] features were unified" )
254
+ . with_stderr_data ( str![ [ r#"
255
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
256
+
257
+ "# ] ] )
251
258
. run ( ) ;
252
259
// Sanity check that compilation without package feature unification does not work
253
260
p. cargo ( "check -p a -p b" )
@@ -266,7 +273,7 @@ fn package_feature_unification_default_features() {
266
273
".cargo/config.toml" ,
267
274
r#"
268
275
[resolver]
269
- feature-unification = "selected "
276
+ feature-unification = "package "
270
277
"# ,
271
278
)
272
279
. file (
@@ -361,8 +368,13 @@ fn package_feature_unification_default_features() {
361
368
p. cargo ( "check" )
362
369
. arg ( "-Zfeature-unification" )
363
370
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
364
- . with_status ( 101 )
365
- . with_stderr_contains ( "[ERROR] features were unified" )
371
+ . with_stderr_data (
372
+ str![ [ r#"
373
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
374
+
375
+ "# ] ]
376
+ . unordered ( ) ,
377
+ )
366
378
. run ( ) ;
367
379
}
368
380
@@ -500,6 +512,34 @@ b v0.1.0 ([ROOT]/foo/b)
500
512
501
513
common v0.1.0 ([ROOT]/foo/common)
502
514
515
+ "# ] ] )
516
+ . run ( ) ;
517
+
518
+ p. cargo ( "tree -e features" )
519
+ . arg ( "-Zfeature-unification" )
520
+ . masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
521
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
522
+ . with_stdout_data ( str![ [ r#"
523
+ common v0.1.0 ([ROOT]/foo/common)
524
+ a v0.1.0 ([ROOT]/foo/a)
525
+ ├── common feature "a"
526
+ │ └── common v0.1.0 ([ROOT]/foo/common)
527
+ ├── common feature "default"
528
+ │ └── common v0.1.0 ([ROOT]/foo/common)
529
+ ├── outside feature "a"
530
+ │ └── outside v0.1.0
531
+ └── outside feature "default"
532
+ └── outside v0.1.0
533
+ b v0.1.0 ([ROOT]/foo/b)
534
+ ├── common feature "b"
535
+ │ └── common v0.1.0 ([ROOT]/foo/common)
536
+ ├── common feature "default"
537
+ │ └── common v0.1.0 ([ROOT]/foo/common)
538
+ ├── outside feature "b"
539
+ │ └── outside v0.1.0
540
+ └── outside feature "default"
541
+ └── outside v0.1.0
542
+
503
543
"# ] ] )
504
544
. run ( ) ;
505
545
}
@@ -572,6 +612,20 @@ fn cargo_install_ignores_config() {
572
612
[INSTALLED] package `a v0.1.0 ([ROOT]/foo)` (executable `a[EXE]`)
573
613
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
574
614
615
+ "# ] ] )
616
+ . run ( ) ;
617
+ cargo_process ( "install --path" )
618
+ . arg ( p. root ( ) )
619
+ . arg ( "-Zfeature-unification" )
620
+ . masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
621
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
622
+ . with_stderr_data ( str![ [ r#"
623
+ [INSTALLING] a v0.1.0 ([ROOT]/foo)
624
+ [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
625
+ [REPLACING] [ROOT]/home/.cargo/bin/a
626
+ [REPLACED] package `a v0.1.0 ([ROOT]/foo)` with `a v0.1.0 ([ROOT]/foo)` (executable `a`)
627
+ [WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
628
+
575
629
"# ] ] )
576
630
. run ( ) ;
577
631
}
@@ -620,6 +674,7 @@ edition = "2021"
620
674
. build ( ) ;
621
675
622
676
p. cargo ( "fix --edition --allow-no-vcs" )
677
+ . env ( "CARGO_RESOLVER_FEATURE_UNIFICATION" , "package" )
623
678
. arg ( "-Zfeature-unification" )
624
679
. masquerade_as_nightly_cargo ( & [ "feature-unification" ] )
625
680
. with_stderr_data ( str![ [ r#"
0 commit comments