Update to the next version of proc-macro2
Depends on dtolnay/quote#73
Depends on alexcrichton/proc-macro2#90
Depends on a new nightly
diff --git a/src/data.rs b/src/data.rs
index 31eb1d1..93a66a1 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -6,6 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+use proc_macro2::Ident;
+
use super::*;
use punctuated::Punctuated;
@@ -322,10 +324,11 @@
#[cfg(feature = "printing")]
mod printing {
use super::*;
- use quote::{ToTokens, Tokens};
+ use proc_macro2::TokenStream;
+ use quote::{ToTokens, TokenStreamExt};
impl ToTokens for Variant {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.append_all(&self.attrs);
self.ident.to_tokens(tokens);
self.fields.to_tokens(tokens);
@@ -337,7 +340,7 @@
}
impl ToTokens for FieldsNamed {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.brace_token.surround(tokens, |tokens| {
self.named.to_tokens(tokens);
});
@@ -345,7 +348,7 @@
}
impl ToTokens for FieldsUnnamed {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.paren_token.surround(tokens, |tokens| {
self.unnamed.to_tokens(tokens);
});
@@ -353,7 +356,7 @@
}
impl ToTokens for Field {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.append_all(&self.attrs);
self.vis.to_tokens(tokens);
if let Some(ref ident) = self.ident {
@@ -365,19 +368,19 @@
}
impl ToTokens for VisPublic {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.pub_token.to_tokens(tokens)
}
}
impl ToTokens for VisCrate {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.crate_token.to_tokens(tokens);
}
}
impl ToTokens for VisRestricted {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.pub_token.to_tokens(tokens);
self.paren_token.surround(tokens, |tokens| {
// XXX: If we have a path which is not "self" or "super" or