@@ -67,10 +67,17 @@ feature is enabled.
67
67
68
68
## Existing editions
69
69
70
- For existing editions, ` cargo ` will warn when parsing a workspace member's
71
- package when an optional dependency is not referenced via ` dep: ` in the
72
- features ([ rust-lang/cargo #9088 ] ( https://github.com/rust-lang/cargo/issues/9088 ) ) using the
73
- planned warning control system ([ rust-lang/cargo #12235 ] ( https://github.com/rust-lang/cargo/issues/12235 ) ).
70
+ As is expected for edition changes, ` cargo fix --edition ` will add ` foo = ["dep:foo"] ` features as needed.
71
+ Where undesired, users can remove these and switch their references to the
72
+ dependency from ` foo ` to ` dep:foo ` ,
73
+ dealing with the [ potential breaking changes] ( https://doc.rust-lang.org/cargo/reference/semver.html#cargo-remove-opt-dep ) .
74
+
75
+ Ideally, this will be accomplished by ` cargo ` emitting an allow-by-defaylt
76
+ warning when parsing a workspace member's package when an optional dependency
77
+ is not referenced via ` dep: ` in the features
78
+ ([ rust-lang/cargo #9088 ] ( https://github.com/rust-lang/cargo/issues/9088 ) )
79
+ using the planned warning control system
80
+ ([ rust-lang/cargo #12235 ] ( https://github.com/rust-lang/cargo/issues/12235 ) ).
74
81
The warning will be named something like ` cargo::implicit_feature ` and be part
75
82
of the ` cargo::rust-202X-compatibility ` group.
76
83
@@ -80,6 +87,8 @@ implicit features for optional dependencies is deprecated and will be unavailabl
80
87
```
81
88
This would be machine applicable with a suggestion to add ` foo = ["dep:foo"] ` . ` cargo fix ` would then insert this feature.
82
89
90
+ If that system is not ready in time, we can always hard code the change in ` cargo fix ` .
91
+
83
92
## Next edition
84
93
85
94
On the next edition, this warning will be a hard error.
0 commit comments