2024 implicit feature migration deletes dependency features #14010
Labels
A-editions
Area: edition-specific issues
A-features
Area: features — conditional compilation
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Migrating to 2024 causes
foo/feature_name
features to get removed for optional dependencies. Those need to be preserved.Steps
Example manifest:
Running
cargo fix --edition
on this will result in:Note that the
/derive
feature got removed.Possible Solution(s)
When there is a
["foo/feature_name"]
syntax in the[features]
table, anddep:foo
isn't found anywhere in the[features]
table, it should be rewritten to be["dep:foo", "foo/feature_name"]
. Some things to be careful of:foo/xxx
is found (such asx = ["foo/a"]
andy = ["foo/b"]
, both x and y need a "dep:foo
")["foo/feature_name", "bar"] would be rewritten to ["dep:foo", "foo/feature_name", "bar"]
)["foo/a", "foo/b"]
should not have twodep:foo
entries added).Notes
No response
Version
The text was updated successfully, but these errors were encountered: