Skip to content

Support inheriting metadata from workspace Cargo.toml #16183

@jhpratt

Description

@jhpratt

Problem

I tried adding this to my workspace Cargo.toml

[workspace.package.metadata.docs.rs]
all-features = true
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = ["--generate-link-to-definition"]

and inheriting it in a package

[package]
# ...
metadata.docs.rs.workspace = true

This did not work, though to Cargo's credit it does provide a warning!

warning: …/Cargo.toml: unused manifest key: workspace.package.metadata

After searching, I found that metadata is not permitted to be inherited (from the Cargo reference).

Proposed Solution

This should "just work" in the same manner as other inherited fields/tables. While this could conceivably cause issues with third-party metadata, the same could be true for a number of other tables that can already be inherited (such as categories, include, keywords, etc.)

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-workspace-inheritanceArea: workspace inheritance RFC 2906C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions