(Note: I'm not sure about the category)
Maybe I'm wrong, but it seems it's impossible to specify features for the examples in
Cargo.toml. Actually, the only way to enable features for an example is either to specify them in the run command:
cargo run --example foo --features my_feature, either to define them as default.
When using an IDE like VSCode, you got errors because the plugin isn't aware about the required features for the example.
I propose to add a
features key in the
[[example]] section in
[[example]] name = "foo" features = ["my_feature"]