File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1650,6 +1650,37 @@ fn warn_inherit_unused_manifest_key_dep() {
1650
1650
. run ( ) ;
1651
1651
}
1652
1652
1653
+ #[ cargo_test]
1654
+ fn warn_unused_workspace_package_field ( ) {
1655
+ Package :: new ( "dep" , "0.1.0" ) . publish ( ) ;
1656
+
1657
+ let p = project ( )
1658
+ . file (
1659
+ "Cargo.toml" ,
1660
+ r#"
1661
+ [workspace]
1662
+ members = []
1663
+ [workspace.package]
1664
+ name = "unused"
1665
+
1666
+ [package]
1667
+ name = "foo"
1668
+ "# ,
1669
+ )
1670
+ . file ( "src/main.rs" , "fn main() {}" )
1671
+ . build ( ) ;
1672
+
1673
+ p. cargo ( "check" )
1674
+ . with_stderr (
1675
+ "\
1676
+ [WARNING] [CWD]/Cargo.toml: unused manifest key: workspace.package.name
1677
+ [CHECKING] foo v0.0.0 ([CWD])
1678
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
1679
+ " ,
1680
+ )
1681
+ . run ( ) ;
1682
+ }
1683
+
1653
1684
#[ cargo_test]
1654
1685
fn warn_inherit_unused_manifest_key_package ( ) {
1655
1686
Package :: new ( "dep" , "0.1.0" ) . publish ( ) ;
You can’t perform that action at this time.
0 commit comments