Different default features for binary target

Hey all,

I have a library crate with an additional binary target:

[features]
default=[]
std=[]

[[bin]]
name="foo"
required-features = ["std"]

I want the library to be nostd by default, but when the binary is compiled, to enable the feature anyway, without having to pass --features std.

Is there a way to enable that?

No, unfortunately the requirement to pass features is there on purpose.

https://github.com/rust-lang/rfcs/pull/3020

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.