Different default features for crate binary and library #12054
Labels
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
I have a crate that is both a library and a binary. I want to be able to specify a default set of features for users of the library and the binary. For instance, people who write
mycrate = "*"
in theirCargo.toml
get a small set of features (and fast compilation times), but when typingcargo install mycrate
they get most or all of the features enabled.This is currently not possible, due to the single
[features] default = […]
field inCargo.toml
.Proposed Solution
The
[lib]
and[[bin]]
sections already have arequired-features = […]
field. I propose we also add adefault-features = […]
field that, if present, will override thedefault
field in[features]
:Notes
No response
The text was updated successfully, but these errors were encountered: