A stable implementation of the upcoming new `proc_macro` API. Comes with an
option, off by default, to also reimplement itself in terms of the upstream
unstable API.
usestd::env;fnmain(){println!("cargo:rerun-if-changed=build.rs");let target =env::var("TARGET").unwrap();maybe_enable_use_proc_macro(&target);}fnmaybe_enable_use_proc_macro(target:&str){// wasm targets don't have the `proc_macro` crate, disable this feature.
if target.contains("wasm32"){return}// There are currently no musl builds of the compiler, so proc_macro is
// always missing, so disable this feature.
if target.contains("-musl"){return}// Otherwise, only enable it if our feature is actually enabled.
ifcfg!(feature ="proc-macro"){println!("cargo:rustc-cfg=use_proc_macro");}}