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/path.rs b/src/path.rs
index 39edd11..f27d6b2 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -7,6 +7,7 @@
// except according to those terms.
use super::*;
+use proc_macro2::Ident;
use punctuated::Punctuated;
ast_struct! {
@@ -41,7 +42,7 @@
/// }
///
/// impl ToTokens for MyNode {
-/// fn to_tokens(&self, tokens: &mut Tokens) {
+/// fn to_tokens(&self, tokens: &mut TokenStream) {
/// PathTokens(&self.qself, &self.path).to_tokens(tokens);
/// }
/// }
@@ -231,7 +232,7 @@
named!(parse -> Self, do_parse!(
colon: option!(punct!(::)) >>
segments: call!(Punctuated::<PathSegment, Token![::]>::parse_separated_nonempty) >>
- cond_reduce!(segments.first().map_or(true, |seg| seg.value().ident != "dyn")) >>
+ cond_reduce!(segments.first().map_or(true, |seg| seg.value().ident.to_string() != "dyn")) >>
(Path {
leading_colon: colon,
segments: segments,
@@ -416,24 +417,25 @@
#[cfg(feature = "printing")]
mod printing {
use super::*;
- use quote::{ToTokens, Tokens};
+ use quote::ToTokens;
+ use proc_macro2::TokenStream;
impl ToTokens for Path {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.leading_colon.to_tokens(tokens);
self.segments.to_tokens(tokens);
}
}
impl ToTokens for PathSegment {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.ident.to_tokens(tokens);
self.arguments.to_tokens(tokens);
}
}
impl ToTokens for PathArguments {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
match *self {
PathArguments::None => {}
PathArguments::AngleBracketed(ref arguments) => {
@@ -448,7 +450,7 @@
impl ToTokens for GenericArgument {
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
match *self {
GenericArgument::Lifetime(ref lt) => lt.to_tokens(tokens),
GenericArgument::Type(ref ty) => ty.to_tokens(tokens),
@@ -473,7 +475,7 @@
}
impl ToTokens for AngleBracketedGenericArguments {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.colon2_token.to_tokens(tokens);
self.lt_token.to_tokens(tokens);
@@ -516,7 +518,7 @@
}
impl ToTokens for Binding {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.ident.to_tokens(tokens);
self.eq_token.to_tokens(tokens);
self.ty.to_tokens(tokens);
@@ -524,7 +526,7 @@
}
impl ToTokens for ParenthesizedGenericArguments {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.paren_token.surround(tokens, |tokens| {
self.inputs.to_tokens(tokens);
});
@@ -533,7 +535,7 @@
}
impl<'a> ToTokens for PathTokens<'a> {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
let qself = match *self.0 {
Some(ref qself) => qself,
None => return self.1.to_tokens(tokens),