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.
This commit is contained in:
David Tolnay 2018-11-11 15:23:32 -08:00
parent c239f03ca8
commit d7568e5332
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -27,6 +27,8 @@ fn main() {
if cfg!(procmacro2_semver_exempt) {
println!("cargo:rustc-cfg=super_unstable");
// https://github.com/alexcrichton/proc-macro2/issues/147
println!("cargo:rustc-cfg=procmacro2_semver_exempt");
}
}