Add a feature for linking to proc_macro.
This feature is enabled by default for backwards compatibility, but
it can be disabled in order to break the runtime dependency on the
dynamic library libproc_macro in the rustc toolchain.
diff --git a/src/buffer.rs b/src/buffer.rs
index 10ac5f6..d92a7a6 100644
--- a/src/buffer.rs
+++ b/src/buffer.rs
@@ -127,6 +127,7 @@
// and caution should be used when editing it. The public-facing interface is
// 100% safe but the implementation is fragile internally.
+#[cfg(feature = "proc-macro")]
use proc_macro as pm;
use proc_macro2::{Delimiter, Literal, Span, Term, TokenStream};
use proc_macro2::{Group, TokenTree, Op};
@@ -219,6 +220,7 @@
/// Creates a `TokenBuffer` containing all the tokens from the input
/// `TokenStream`.
+ #[cfg(feature = "proc-macro")]
pub fn new(stream: pm::TokenStream) -> TokenBuffer {
Self::new2(stream.into())
}