According to the docs "For rustc, arbitrary-set configuration options are set using the --cfg flag." Sure enough I can enable the message using rustc --cfg foo main.rs
. How do I do this in cargo?
fn main() {
#[cfg(foo)]
println!("FOO");
}
Note: I'd rather not use a feature as discussed in this question. Alternatively convince me why I should always use a feature flag for custom compile time options.