Move all #[derive] impls behind Cargo feature gates
This commit moves all #[derive] annotations behind Cargo feature gates to add
the ability to strip them all out entirely. The `Clone` and `Copy` impls
continue to be enabled by default as they tend to be mega useful but other
equality/hash/debug impls are all default behind the `extra-impls` gate.
This commit, on my computer, has the following timings:
| features | before | after
|-------------------------------|---------|------
| default | 3.67 | 2.96
| *none* | 1.78 | 0.49
| {printing, parsing} | 3.71 | 2.57
| default + {full} | 8.50 | 6.31
| {full} | 3.53 | 0.70
| {full, printing, parsing} | 8.10 | 5.29
Closes #143
diff --git a/tests/test_generics.rs b/tests/test_generics.rs
index 08886bb..92ae9e9 100644
--- a/tests/test_generics.rs
+++ b/tests/test_generics.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "extra-traits")]
+
extern crate syn;
use syn::*;
diff --git a/tests/test_macro_input.rs b/tests/test_macro_input.rs
index 4e6bbd8..653fbe2 100644
--- a/tests/test_macro_input.rs
+++ b/tests/test_macro_input.rs
@@ -2,6 +2,7 @@
//!
//! Deprecation warnings are suppressed to keep the output clean.
#![allow(deprecated)]
+#![cfg(feature = "extra-traits")]
extern crate syn;
use syn::*;
diff --git a/tests/test_meta_item.rs b/tests/test_meta_item.rs
index 735c9a2..72cec3a 100644
--- a/tests/test_meta_item.rs
+++ b/tests/test_meta_item.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "extra-traits")]
+
extern crate syn;
use syn::*;
diff --git a/tests/test_token_trees.rs b/tests/test_token_trees.rs
index 8351f54..33dbdda 100644
--- a/tests/test_token_trees.rs
+++ b/tests/test_token_trees.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "extra-traits")]
+
extern crate syn;
use syn::TokenTree::{self, Token};
use syn::DelimToken::*;