Have cargo add --optional <dep>
create a <dep> = "dep:<dep>
feature
#11010
Labels
C-enhancement
Category: enhancement
Command-add
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
Problem
This is inspired by my running
cargo add
and seeing a lot of features that might be there only because people have not updated to the newdep:
syntax to disable unintended implicit features. For my crates, I'm aware of the syntax and plan to transition my crates. For others, they might not be aware the feature exists and by uscargo add
turning it explicit, it would help raise visibility on these features to help lead more people to using it.In addition, #10556 mentions the idea of
cargo fix
doingie by convention moving away from implicit feature declarations.
Proposed Solution
cargo add --optional <dep>
would create a<dep> = "dep:<dep>
feature iffrust-version
is unset or is new enough for the syntaxdep:<dep>
doesn't already existThe text was updated successfully, but these errors were encountered: