Cargo warnings: unused manifest key

Hi all,

When compiling my project for which I'm using workspaces, I get lots of warnings like:

warning: Cargo.toml: unused manifest key: workspace.edition
warning: Cargo.toml: unused manifest key: workspace.name
warning: Cargo.toml: unused manifest key: workspace.package.autotests
warning: Cargo.toml: unused manifest key: workspace.package.doctest
warning: Cargo.toml: unused manifest key: workspace.package.name
warning: Cargo.toml: unused manifest key: workspace.version

Can't spot the source of these warnings because I'm using those keys in related Cargo.toml files.

Any hint ?

Thanks for your help.

How is your directory structure? Which Cargo.toml files contain workspace properties? What rustc version?

1 Like

@alice Version is 1.75. You can look at my repo here: GitHub - dandyvica/dqy: A DNS query tool
but basically a main Cargo.toml which defines dependencies and sub-Cargo.tomls which use definitions from the former.

You have these lines in your manifest:

[workspace]
name = "dqy"
version = "0.2.0"
edition = "2021"
members = [ ... ]
resolver = "2"

[workspace.package]
name = "dqy"
version = "0.1.0"  #:version
...

Workspaces themselves do not have names, versions, or editions, so those first three lines don't mean anything at all to Cargo.

The warnings about workspace.package.* are because those keys are not one of the keys supported for workspace inheritance. Also, it doesn't make sense to inherit package.name anyway, because each package needs a unique name.

1 Like

@kpreid Thanks for your answer, that makes sense.