Actually allow disabling proc-macro feature in tests
diff --git a/.travis.yml b/.travis.yml
index f987dc2..081123b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,7 +9,7 @@
- rust: nightly
script:
- cargo test
- - cargo test --no-default-features
+ - cargo test --no-default-features -- --ignored # run the ignored test to make sure the `proc-macro` feature is disabled
- cargo test --features span-locations
- RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test
- RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --no-default-features
diff --git a/Cargo.toml b/Cargo.toml
index a86b93b..7f30e14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,7 +26,7 @@
unicode-xid = "0.2"
[dev-dependencies]
-quote = "1.0"
+quote = { version = "1.0", default_features = false }
[features]
proc-macro = []
diff --git a/src/lib.rs b/src/lib.rs
index 9f1d89b..f81ca1b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -31,6 +31,7 @@
//! # const IGNORE: &str = stringify! {
//! #[proc_macro_derive(MyDerive)]
//! # };
+//! # #[cfg(wrap_proc_macro)]
//! pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
//! let input = proc_macro2::TokenStream::from(input);
//!
diff --git a/tests/features.rs b/tests/features.rs
new file mode 100644
index 0000000..b61e337
--- /dev/null
+++ b/tests/features.rs
@@ -0,0 +1,4 @@
+#[test] #[ignore]
+fn make_sure_no_proc_macro() {
+ assert!(!cfg!(feature = "proc-macro"), "still compiled with proc_macro?");
+}