Skip to content

Transition out weak feature syntax in an edition #10556

Open
@ehuss

Description

@ehuss

Problem

The difference between package/feature and package?/feature syntax is unfortunate as it can be a little confusing and inelegant. Ideally we would have kept the original syntax, but the ? was added to retain backwards compatibility.

Proposed Solution

It might be worth considering dropping the ? syntax in the next edition. package/feature would behave the same as the ? variant. With the use of toml_edit, it may be possible to enhance cargo fix in order to automatically update Cargo.toml to retain backwards compatibility. If the package is optional, then it would rewrite the [features] table to convert "package/feature" to "dep:package", "package/feature" (and also possibly define a feature named "package" if it doesn't already exist and dep:package isn't already used).

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-nextArea: may require a breaking change over an editionA-featuresArea: features — conditional compilationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-team-inputStatus: Needs input from team on whether/how to proceed.T-infraTeam: infrastructure

    Type

    No type

    Projects

    Status

    Ideas

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions