Transition out implicit features for optional dependencies #12173
Labels
A-edition-next
Area: may require a breaking change over an edition
A-features
Area: features — conditional compilation
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Problem
Today cargo will implicitly create a feature for optional dependencies unless the dependency is referenced in a feature as
dep:<dep_name>
.Downsides
dep:
and unintentionally create featuresfeatures
list confusing #9459)cargo metadata
no longer distinguishes between "magical" features from optional deps and normal features #10543)Proposed Solution
We should stop implicitly creating features in a new Edition
Optional dependencies without a
dep:
reference can be either#[cfg(accessible)]
cargo add foo --optional
can implicitly create a feature with the dependency's name, if adep:foo
doesn't already exist (#11010).Notes
No response
The text was updated successfully, but these errors were encountered: