Skip to content

Should warn on optional dep not used in any feature #9088

@gdesmott

Description

@gdesmott

Cargo could raise a warning when user defines an optional dependency which is not part of any feature.

I've been confused for a while trying to figure out why building my single feature project with --all-features was working while building it with --features=my-feature was not. Turned out I forgot to include one optional dep with the feature. Such warning would have prevent me from doing such stupid mistake. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.A-featuresArea: features — conditional compilationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions