Skip to content

does not have these features: default #8164

@infinity0

Description

@infinity0

All crates have the "default" feature implicitly, however I can't refer to it on the command line:

$ cargo test --features default
    Updating crates.io index
error: Package `$whatever` does not have these features: `default`
exit code 101

This only works if Cargo.toml defines a feature "default" explicitly. However the other way around works - if Cargo.toml defines a feature "default" explicitly, giving no --feature flags to cargo will enable it implicitly.

This behaviour is surprising when writing automatic scripts / programs, since a lot of logic doesn't need to special-case the "default" feature. However this aspect of the CLI forces the logic to add a special-case for it.

It is sort of analogous to why id = \x -> x and all [] = true are useful things to have, to make programs behave more consistently and predictably under large-scale composition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-featuresArea: features — conditional compilationC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions