Description
Summary
Original issue: #3494
Implementation: #8818
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#weak-dependency-features
-Z weak-dep-features
will enable "weak" dependency features, whereby dep_name?/feature_name
syntax in the [features]
table will not automatically enable the dep_name
dependency (unlike the dep_name/feature_name
syntax which always enables dep_name
). This just indicates that the feature on that dependency should be enabled if something else enables that dependency on this package.
Unresolved issues
- Bike shed the syntax. We've discussed various variants:
dep_name?/feat_name
?dep_name/feat_name
dep_name?feat_name
- Or maybe something more verbose like
{dep="dep_name", feature="feat_name", enable-dep=false}
- Or a more verbose string format, like
if-dep:dep_name/feat_name
(read this as "if dependency foo then enable feature bar"). - Concerns:
- Too verbose, and people may be less likely to use it.
- Terse
?
format means people will have to look up what it means, and searching for punctuation is difficult. - Interaction with
org_name/pkg_name
syntax, which could contribute to the punctuation soup.
- Possibly make this the default behavior for
dep_name/feat_name
syntax on an edition boundary. A concern is that this is not an (easily) rustfix-able change. - Figure out how to deal with breakage of Cargo versions older than 1.19. Resolved in Add schema field and
features2
to the index. #9161.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Metadata
Assignees
Type
Projects
Status
Done