support feature gated package metadata #14770
Labels
A-features
Area: features — conditional compilation
A-manifest
Area: Cargo.toml issues
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-info
Status: Needs more info, such as a reproduction or more background for a feature request.
Problem
Hello everyone! Sorry if similar issue already exists, I could not find something like this.
While discussing the MSRV in tqwewe/kameo#76, we figured out that the currently MSRV could be lower, but a certain non-default feature requires the higher version.
Would it be possible for cargo to support package metadata that is feature gated? For example,
rust-version
is set to1.65
per default, but if featurefeat-a
is enabled, that sets therust-version
to1.75
.Proposed Solution
Syntax for dependencies already exists, as described in the Cargo book:
Maybe similar syntax can be used for other tables:
Alternatively, we could extend features to support (inline) tables:
Notes
No response
The text was updated successfully, but these errors were encountered: