-
Couldn't load subscription status.
- Fork 2.7k
Description
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.