Skip to content

Warn or error when using mandatory dependencies as a feature #4363

@RalfJung

Description

@RalfJung

Currently, Cargo warns when I ask for a feature of another crate that does not exist. However, it seems that it treats all dependencies also as features. For optional dependencies, this makes sense, and indeed the documentation says "A feature of a package is either an optional dependency, or a set of other features."

So, I can depend on regex = { version = "0.2.2", features = ["memchr"]} and there is no warning or error that this (a) doesn't make any sense, and (b) memchr is not technically a feature according to the definition of the docs (and indeed, it should not be).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions