Skip to content

Commit

Permalink
fix: Focus existing edition behavior on goal and list contingency
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 3, 2023
1 parent fa464d1 commit b1c02ae
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions text/3491-remove-implicit-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,17 @@ feature is enabled.

## Existing editions

For existing editions, `cargo` will warn when parsing a workspace member's
package when an optional dependency is not referenced via `dep:` in the
features ([rust-lang/cargo#9088](https://github.com/rust-lang/cargo/issues/9088)) using the
planned warning control system ([rust-lang/cargo#12235](https://github.com/rust-lang/cargo/issues/12235)).
As is expected for edition changes, `cargo fix --edition` will add `foo = ["dep:foo"]` features as needed.
Where undesired, users can remove these and switch their references to the
dependency from `foo` to `dep:foo`,
dealing with the [potential breaking changes](https://doc.rust-lang.org/cargo/reference/semver.html#cargo-remove-opt-dep).

Ideally, this will be accomplished by `cargo` emitting an allow-by-defaylt
warning when parsing a workspace member's package when an optional dependency
is not referenced via `dep:` in the features
([rust-lang/cargo#9088](https://github.com/rust-lang/cargo/issues/9088))
using the planned warning control system
([rust-lang/cargo#12235](https://github.com/rust-lang/cargo/issues/12235)).
The warning will be named something like `cargo::implicit_feature` and be part
of the `cargo::rust-202X-compatibility` group.

Expand All @@ -80,6 +87,8 @@ implicit features for optional dependencies is deprecated and will be unavailabl
```
This would be machine applicable with a suggestion to add `foo = ["dep:foo"]`. `cargo fix` would then insert this feature.

If that system is not ready in time, we can always hard code the change in `cargo fix`.

## Next edition

On the next edition, this warning will be a hard error.
Expand Down

0 comments on commit b1c02ae

Please sign in to comment.