-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
A-featuresArea: features — conditional compilationArea: features — conditional compilationA-required-featuresArea: required-features settingArea: required-features settingC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Description
If I have a crate like:
[package]
name = "foo"
[features]
myfeature = []
another = []
[[example]]
name = "myexample"
required-features = ["myfeature", "another"]
It would be awesome if cargo run --example myexample
automatically enabled the myfeature
feature for me, rather than producing an error message like it does today. There is no situation where I can do anything useful without padding the additional --features myfeature
flag.
This is the current message:
error: target `myexample` requires the features: `myfeature`, `another`
Consider enabling them by passing e.g. `--features="myfeature another"`
See also #2911
kvark, kennytm, sanpii, aspurdy, mdenchev and 115 more
Metadata
Metadata
Assignees
Labels
A-featuresArea: features — conditional compilationArea: features — conditional compilationA-required-featuresArea: required-features settingArea: required-features settingC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.