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/lit.rs b/src/lit.rs
index 5096b1b..a1e5844 100644
--- a/src/lit.rs
+++ b/src/lit.rs
@@ -10,7 +10,7 @@
use std::str;
#[cfg(feature = "printing")]
-use proc_macro2::Term;
+use proc_macro2::Ident;
#[cfg(feature = "parsing")]
use proc_macro2::TokenStream;
@@ -432,9 +432,9 @@
_ => match input.term() {
Some((term, rest)) => Ok((
Lit::Bool(LitBool {
- value: if term.as_str() == "true" {
+ value: if term.to_string() == "true" {
true
- } else if term.as_str() == "false" {
+ } else if term.to_string() == "false" {
false
} else {
return parse_error();
@@ -506,53 +506,54 @@
#[cfg(feature = "printing")]
mod printing {
use super::*;
- use quote::{ToTokens, Tokens};
+ use quote::{ToTokens, TokenStreamExt};
+ use proc_macro2::TokenStream;
impl ToTokens for LitStr {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}
impl ToTokens for LitByteStr {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}
impl ToTokens for LitByte {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}
impl ToTokens for LitChar {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}
impl ToTokens for LitInt {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}
impl ToTokens for LitFloat {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}
impl ToTokens for LitBool {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
let s = if self.value { "true" } else { "false" };
- tokens.append(Term::new(s, self.span));
+ tokens.append(Ident::new(s, self.span));
}
}
impl ToTokens for LitVerbatim {
- fn to_tokens(&self, tokens: &mut Tokens) {
+ fn to_tokens(&self, tokens: &mut TokenStream) {
self.token.to_tokens(tokens);
}
}