Skip to content

Commit

Permalink
Auto merge of #13263 - epage:unused2, r=ehuss
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jan 8, 2024
2 parents 8fefb3c + 96fa278 commit bde42f1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/testsuite/inheritable_workspace_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,37 @@ fn warn_inherit_unused_manifest_key_dep() {
.run();
}

#[cargo_test]
fn warn_unused_workspace_package_field() {
Package::new("dep", "0.1.0").publish();

let p = project()
.file(
"Cargo.toml",
r#"
[workspace]
members = []
[workspace.package]
name = "unused"
[package]
name = "foo"
"#,
)
.file("src/main.rs", "fn main() {}")
.build();

p.cargo("check")
.with_stderr(
"\
[WARNING] [CWD]/Cargo.toml: unused manifest key: workspace.package.name
[CHECKING] foo v0.0.0 ([CWD])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
}

#[cargo_test]
fn warn_inherit_unused_manifest_key_package() {
Package::new("dep", "0.1.0").publish();
Expand Down

0 comments on commit bde42f1

Please sign in to comment.