Skip to content

Unable to use a feature of an optional dependency from a feature #3494

Closed

Description

For example lets say we use

[dependencies.serde]
version = "0.8.*"
optional = true
default-features = false

and we want to use the std feature of serde if it is used.

[features]
std = ["serde/std"]

But now if someone wants to use our std feature serde WILL be imported. If I would want to represent this I would write

[features]
std = ["serde", "serde/std"]

Right now it's impossible to use a feature of an optional dependency from an own feature without forcing it to be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

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