Skip to content

Enable features on an indirect dependency exposed via public API #8413

@jhpratt

Description

@jhpratt

Describe the problem you are trying to solve
Enable a feature on an indirect dependency (that is exposed in public API)

Describe the solution you'd like
Something like the following?

sha2 = { version = "0.9", features = ["digest/more_lengths"] }

This would require explicit knowledge of the dependencies. This is admittedly not the best of ideas, but could be limited to situations where the type is only in the public API. I've no idea how that would interact with Cargo, however.

Notes
This would be analogous to enabling features of direct dependencies in a crate's features listing, though it wouldn't require the intermediate crate to re-export features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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