Skip to content

Commit bde42f1

Browse files
committed
Auto merge of #13263 - epage:unused2, r=ehuss
test(manifest): Verify we warn on unused workspace.package fields I assumed from #13258 that we didn't warn but apparently we do. Figured it'd still be good to keep the test around.
2 parents 8fefb3c + 96fa278 commit bde42f1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/testsuite/inheritable_workspace_fields.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,37 @@ fn warn_inherit_unused_manifest_key_dep() {
16501650
.run();
16511651
}
16521652

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+
16531684
#[cargo_test]
16541685
fn warn_inherit_unused_manifest_key_package() {
16551686
Package::new("dep", "0.1.0").publish();

0 commit comments

Comments
 (0)