Allow to use procmacro2_semver_exempt on stable rust
procmacro2_semver_exempt is working on rust < 1.29, but
since 1.29, proc_macro2 forward to proc_macro even when
procmacro2_semver_exempt is set, which require a nightly
compiler
diff --git a/.travis.yml b/.travis.yml
index 0234f4e..0c1d3e0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,6 +27,7 @@
script:
- cargo test
+ - RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test
notifications:
email:
diff --git a/build.rs b/build.rs
index 784c59c..cd6df23 100644
--- a/build.rs
+++ b/build.rs
@@ -22,7 +22,7 @@
println!("cargo:rustc-cfg=use_proc_macro");
// Rust 1.29 stabilized the necessary APIs in the `proc_macro` crate
- if minor >= 29 || cfg!(feature = "nightly") {
+ if (minor >= 29 && !cfg!(procmacro2_semver_exempt)) || cfg!(feature = "nightly") {
println!("cargo:rustc-cfg=wrap_proc_macro");
if cfg!(procmacro2_semver_exempt) {