Skip to content

Commit d7568e5

Browse files
committed
Work around when built as a dependency in docs.rs
Our build script has: if cfg!(procmacro2_semver_exempt) { println!("cargo:rustc-cfg=super_unstable"); } But when proc-macro2 is built as a dependency of another crate in docs.rs, we are seeing the builder invoke rustc with `--cfg super_unstable` but without `--cfg procmacro2_semver_exempt`. The super_unstable flag is only set on that one line, so procmacro2_semver_exempt should have also been set. Hopefully this change will result in both flags being passed. We will need to figure out how to set unstable flags only when building our own docs.rs docs, not when building proc-macro2 as a dependency of a different crate.
1 parent c239f03 commit d7568e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ fn main() {
2727

2828
if cfg!(procmacro2_semver_exempt) {
2929
println!("cargo:rustc-cfg=super_unstable");
30+
// https://github.com/alexcrichton/proc-macro2/issues/147
31+
println!("cargo:rustc-cfg=procmacro2_semver_exempt");
3032
}
3133
}
3234

0 commit comments

Comments
 (0)