use std::env;
fn main() {
if cfg!(pin_project_show_unpin_struct) && feature_allowed("proc_macro_def_site") {
println!("cargo:rustc-cfg=proc_macro_def_site");
}
}
fn feature_allowed(feature: &str) -> bool {
if let Some(rustflags) = env::var_os("RUSTFLAGS") {
for mut flag in rustflags.to_string_lossy().split(' ') {
if flag.starts_with("-Z") {
flag = &flag["-Z".len()..];
}
if flag.starts_with("allow-features=") {
flag = &flag["allow-features=".len()..];
return flag.split(',').any(|allowed| allowed == feature);
}
}
}
true
}