@@ -1518,6 +1518,59 @@ true for `workspace.dependencies.dep`, this could become a hard error in the fut
1518
1518
. run ( ) ;
1519
1519
}
1520
1520
1521
+ #[ cargo_test( nightly, reason = "edition2024 is not stable" ) ]
1522
+ fn warn_inherit_def_feat_true_member_def_feat_false_2024_edition ( ) {
1523
+ Package :: new ( "dep" , "0.1.0" )
1524
+ . feature ( "default" , & [ "fancy_dep" ] )
1525
+ . add_dep ( Dependency :: new ( "fancy_dep" , "0.2" ) . optional ( true ) )
1526
+ . file ( "src/lib.rs" , "" )
1527
+ . publish ( ) ;
1528
+
1529
+ Package :: new ( "fancy_dep" , "0.2.4" ) . publish ( ) ;
1530
+
1531
+ let p = project ( )
1532
+ . file (
1533
+ "Cargo.toml" ,
1534
+ r#"
1535
+ cargo-features = ["edition2024"]
1536
+
1537
+ [package]
1538
+ name = "bar"
1539
+ version = "0.2.0"
1540
+ edition = "2024"
1541
+ authors = []
1542
+ [dependencies]
1543
+ dep = { workspace = true, default-features = false }
1544
+
1545
+ [workspace]
1546
+ members = []
1547
+ [workspace.dependencies]
1548
+ dep = { version = "0.1.0", default-features = true }
1549
+ "# ,
1550
+ )
1551
+ . file ( "src/main.rs" , "fn main() {}" )
1552
+ . build ( ) ;
1553
+
1554
+ p. cargo ( "check" )
1555
+ . masquerade_as_nightly_cargo ( & [ "edition2024" ] )
1556
+ . with_stderr (
1557
+ "\
1558
+ [WARNING] [CWD]/Cargo.toml: `default-features` is ignored for dep, since `default-features` was \
1559
+ true for `workspace.dependencies.dep`, this could become a hard error in the future
1560
+ [UPDATING] `dummy-registry` index
1561
+ [LOCKING] 3 packages to latest Rust [..] compatible versions
1562
+ [DOWNLOADING] crates ...
1563
+ [DOWNLOADED] fancy_dep v0.2.4 ([..])
1564
+ [DOWNLOADED] dep v0.1.0 ([..])
1565
+ [CHECKING] fancy_dep v0.2.4
1566
+ [CHECKING] dep v0.1.0
1567
+ [CHECKING] bar v0.2.0 ([CWD])
1568
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
1569
+ " ,
1570
+ )
1571
+ . run ( ) ;
1572
+ }
1573
+
1521
1574
#[ cargo_test]
1522
1575
fn warn_inherit_simple_member_def_feat_false ( ) {
1523
1576
Package :: new ( "dep" , "0.1.0" )
@@ -1568,6 +1621,59 @@ not specified for `workspace.dependencies.dep`, this could become a hard error i
1568
1621
. run ( ) ;
1569
1622
}
1570
1623
1624
+ #[ cargo_test( nightly, reason = "edition2024 is not stable" ) ]
1625
+ fn warn_inherit_simple_member_def_feat_false_2024_edition ( ) {
1626
+ Package :: new ( "dep" , "0.1.0" )
1627
+ . feature ( "default" , & [ "fancy_dep" ] )
1628
+ . add_dep ( Dependency :: new ( "fancy_dep" , "0.2" ) . optional ( true ) )
1629
+ . file ( "src/lib.rs" , "" )
1630
+ . publish ( ) ;
1631
+
1632
+ Package :: new ( "fancy_dep" , "0.2.4" ) . publish ( ) ;
1633
+
1634
+ let p = project ( )
1635
+ . file (
1636
+ "Cargo.toml" ,
1637
+ r#"
1638
+ cargo-features = ["edition2024"]
1639
+
1640
+ [package]
1641
+ name = "bar"
1642
+ version = "0.2.0"
1643
+ edition = "2024"
1644
+ authors = []
1645
+ [dependencies]
1646
+ dep = { workspace = true, default-features = false }
1647
+
1648
+ [workspace]
1649
+ members = []
1650
+ [workspace.dependencies]
1651
+ dep = "0.1.0"
1652
+ "# ,
1653
+ )
1654
+ . file ( "src/main.rs" , "fn main() {}" )
1655
+ . build ( ) ;
1656
+
1657
+ p. cargo ( "check" )
1658
+ . masquerade_as_nightly_cargo ( & [ "edition2024" ] )
1659
+ . with_stderr (
1660
+ "\
1661
+ [WARNING] [CWD]/Cargo.toml: `default-features` is ignored for dep, since `default-features` was \
1662
+ not specified for `workspace.dependencies.dep`, this could become a hard error in the future
1663
+ [UPDATING] `dummy-registry` index
1664
+ [LOCKING] 3 packages to latest compatible versions
1665
+ [DOWNLOADING] crates ...
1666
+ [DOWNLOADED] fancy_dep v0.2.4 ([..])
1667
+ [DOWNLOADED] dep v0.1.0 ([..])
1668
+ [CHECKING] fancy_dep v0.2.4
1669
+ [CHECKING] dep v0.1.0
1670
+ [CHECKING] bar v0.2.0 ([CWD])
1671
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
1672
+ " ,
1673
+ )
1674
+ . run ( ) ;
1675
+ }
1676
+
1571
1677
#[ cargo_test]
1572
1678
fn inherit_def_feat_false_member_def_feat_true ( ) {
1573
1679
Package :: new ( "dep" , "0.1.0" )
0 commit comments