[−][src]Macro cargo_emit::rustc_cfg
Tells Cargo to enable a $feature
.
This is equivalent to:
println!("cargo:rustc-cfg=$feature");
Examples
Useful for conditionally enabling certain code to run.
if cargo.can_bench() { cargo_emit::rustc_cfg!("bench"); }
Then outside of build.rs
:
#[cfg(bench)] mod benches { // ... }