Enabling feature in optional dependency causes downloading of that dependency's metadata #15482
Labels
A-dependency-resolution
Area: dependency resolution and the resolver
A-features2
Area: issues specifically related to the v2 feature resolver
A-lockfile
Area: Cargo.lock issues
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Given three crates A, B, and C, such that:
?/
syntax (e.g.,feature_F = ["crate_C?/feature_F"]
)Then enabling feature F on B causes the metadata for crate C to be fetched, even though C does not appear in the dependency graph for A.
Steps
bug2
)cargo check
toml_edit
appears in the top-levelCargo.lock
Possible Solution(s)
No response
Notes
Removing
"parse"
in the list of requested features in the top-levelCargo.lock
causestoml_edit
to no longer be fetched. In other words, replace this line:with this line:
I expect that both of these should behave the same with respect to whether
toml_edit
metadata is fetched, since theparse
feature doesn't actually depend ontoml_edit
.Version
The text was updated successfully, but these errors were encountered: