@@ -640,6 +640,9 @@ fn install_default_features() {
640
640
[INSTALLING] foo v0.0.1 ([..])
641
641
[FINISHED] release [optimized] target(s) in [..]
642
642
[WARNING] none of the package's binaries are available for install using the selected features
643
+ bin \" foo\" requires the features: `a`
644
+ example \" foo\" requires the features: `a`
645
+ Consider enabling some of the needed features by passing, e.g., `--features=\" a\" `
643
646
" ,
644
647
)
645
648
. run ( ) ;
@@ -792,6 +795,11 @@ fn install_multiple_required_features() {
792
795
[INSTALLING] foo v0.0.1 ([..])
793
796
[FINISHED] release [optimized] target(s) in [..]
794
797
[WARNING] none of the package's binaries are available for install using the selected features
798
+ bin \" foo_1\" requires the features: `b`, `c`
799
+ bin \" foo_2\" requires the features: `a`
800
+ example \" foo_3\" requires the features: `b`, `c`
801
+ example \" foo_4\" requires the features: `a`
802
+ Consider enabling some of the needed features by passing, e.g., `--features=\" b c\" `
795
803
" ,
796
804
)
797
805
. run ( ) ;
@@ -802,6 +810,11 @@ fn install_multiple_required_features() {
802
810
[WARNING] Target filter `bins` specified, but no targets matched. This is a no-op
803
811
[FINISHED] release [optimized] target(s) in [..]
804
812
[WARNING] none of the package's binaries are available for install using the selected features
813
+ bin \" foo_1\" requires the features: `b`, `c`
814
+ bin \" foo_2\" requires the features: `a`
815
+ example \" foo_3\" requires the features: `b`, `c`
816
+ example \" foo_4\" requires the features: `a`
817
+ Consider enabling some of the needed features by passing, e.g., `--features=\" b c\" `
805
818
" ,
806
819
)
807
820
. run ( ) ;
@@ -812,6 +825,11 @@ fn install_multiple_required_features() {
812
825
[WARNING] Target filter `examples` specified, but no targets matched. This is a no-op
813
826
[FINISHED] release [optimized] target(s) in [..]
814
827
[WARNING] none of the package's binaries are available for install using the selected features
828
+ bin \" foo_1\" requires the features: `b`, `c`
829
+ bin \" foo_2\" requires the features: `a`
830
+ example \" foo_3\" requires the features: `b`, `c`
831
+ example \" foo_4\" requires the features: `a`
832
+ Consider enabling some of the needed features by passing, e.g., `--features=\" b c\" `
815
833
" ,
816
834
)
817
835
. run ( ) ;
@@ -822,6 +840,11 @@ fn install_multiple_required_features() {
822
840
[WARNING] Target filters `bins`, `examples` specified, but no targets matched. This is a no-op
823
841
[FINISHED] release [optimized] target(s) in [..]
824
842
[WARNING] none of the package's binaries are available for install using the selected features
843
+ bin \" foo_1\" requires the features: `b`, `c`
844
+ bin \" foo_2\" requires the features: `a`
845
+ example \" foo_3\" requires the features: `b`, `c`
846
+ example \" foo_4\" requires the features: `a`
847
+ Consider enabling some of the needed features by passing, e.g., `--features=\" b c\" `
825
848
" ,
826
849
)
827
850
. run ( ) ;
@@ -1080,6 +1103,9 @@ Consider enabling them by passing, e.g., `--features=\"bar/a\"`
1080
1103
[INSTALLING] foo v0.0.1 ([..])
1081
1104
[FINISHED] release [optimized] target(s) in [..]
1082
1105
[WARNING] none of the package's binaries are available for install using the selected features
1106
+ bin \" foo\" requires the features: `bar/a`
1107
+ example \" foo\" requires the features: `bar/a`
1108
+ Consider enabling some of the needed features by passing, e.g., `--features=\" bar/a\" `
1083
1109
" ,
1084
1110
)
1085
1111
. run ( ) ;
@@ -1333,3 +1359,94 @@ Consider enabling them by passing, e.g., `--features=\"a1/f1\"`
1333
1359
. with_stdout ( "a1 f1\n a2 f2" )
1334
1360
. run ( ) ;
1335
1361
}
1362
+
1363
+ #[ cargo_test]
1364
+ fn truncated_install_warning_message ( ) {
1365
+ let p = project ( )
1366
+ . file (
1367
+ "Cargo.toml" ,
1368
+ r#"
1369
+ [package]
1370
+ name = "foo"
1371
+ version = "0.1.0"
1372
+ edition = "2021"
1373
+
1374
+ [features]
1375
+ feature1 = []
1376
+ feature2 = []
1377
+ feature3 = []
1378
+ feature4 = []
1379
+ feature5 = []
1380
+
1381
+ [[bin]]
1382
+ name = "foo1"
1383
+ required-features = ["feature1", "feature2", "feature3"]
1384
+
1385
+ [[bin]]
1386
+ name = "foo2"
1387
+ required-features = ["feature2"]
1388
+
1389
+ [[bin]]
1390
+ name = "foo3"
1391
+ required-features = ["feature3"]
1392
+
1393
+ [[bin]]
1394
+ name = "foo4"
1395
+ required-features = ["feature4", "feature1"]
1396
+
1397
+ [[bin]]
1398
+ name = "foo5"
1399
+ required-features = ["feature1", "feature2", "feature3", "feature4", "feature5"]
1400
+
1401
+ [[bin]]
1402
+ name = "foo6"
1403
+ required-features = ["feature1", "feature2", "feature3", "feature4", "feature5"]
1404
+
1405
+ [[bin]]
1406
+ name = "foo7"
1407
+ required-features = ["feature1", "feature2", "feature3", "feature4", "feature5"]
1408
+
1409
+ [[bin]]
1410
+ name = "foo8"
1411
+ required-features = ["feature1", "feature2", "feature3", "feature4", "feature5"]
1412
+
1413
+ [[bin]]
1414
+ name = "foo9"
1415
+ required-features = ["feature1", "feature2", "feature3", "feature4", "feature5"]
1416
+
1417
+ [[bin]]
1418
+ name = "foo10"
1419
+ required-features = ["feature1", "feature2", "feature3", "feature4", "feature5"]
1420
+
1421
+ [[example]]
1422
+ name = "example1"
1423
+ required-features = ["feature1", "feature2"]
1424
+ "# ,
1425
+ )
1426
+ . file ( "src/bin/foo1.rs" , "fn main() {}" )
1427
+ . file ( "src/bin/foo2.rs" , "fn main() {}" )
1428
+ . file ( "src/bin/foo3.rs" , "fn main() {}" )
1429
+ . file ( "src/bin/foo4.rs" , "fn main() {}" )
1430
+ . file ( "src/bin/foo5.rs" , "fn main() {}" )
1431
+ . file ( "src/bin/foo6.rs" , "fn main() {}" )
1432
+ . file ( "src/bin/foo7.rs" , "fn main() {}" )
1433
+ . file ( "src/bin/foo8.rs" , "fn main() {}" )
1434
+ . file ( "src/bin/foo9.rs" , "fn main() {}" )
1435
+ . file ( "src/bin/foo10.rs" , "fn main() {}" )
1436
+ . file ( "examples/example1.rs" , "fn main() {}" )
1437
+ . build ( ) ;
1438
+
1439
+ p. cargo ( "install --path ." ) . with_stderr ( "\
1440
+ [INSTALLING] foo v0.1.0 ([..])
1441
+ [FINISHED] release [optimized] target(s) in [..]
1442
+ [WARNING] none of the package's binaries are available for install using the selected features
1443
+ bin \" foo1\" requires the features: `feature1`, `feature2`, `feature3`
1444
+ bin \" foo2\" requires the features: `feature2`
1445
+ bin \" foo3\" requires the features: `feature3`
1446
+ bin \" foo4\" requires the features: `feature4`, `feature1`
1447
+ bin \" foo5\" requires the features: `feature1`, `feature2`, `feature3`, `feature4`, `feature5`
1448
+ bin \" foo6\" requires the features: `feature1`, `feature2`, `feature3`, `feature4`, `feature5`
1449
+ bin \" foo7\" requires the features: `feature1`, `feature2`, `feature3`, `feature4`, `feature5`
1450
+ 4 more targets also requires features not enabled. See them in the Cargo.toml file.
1451
+ Consider enabling some of the needed features by passing, e.g., `--features=\" feature1 feature2 feature3\" `" ) . run ( ) ;
1452
+ }
0 commit comments