Update to syn/quote/proc-macro2 new apis

This commit is contained in:
Alex Crichton
2018-03-28 15:49:51 -07:00
parent b77cfb635d
commit b1c1d964e1
8 changed files with 31 additions and 25 deletions
+6 -6
View File
@@ -181,8 +181,8 @@ enum BorrowedLifetimes {
impl BorrowedLifetimes {
fn de_lifetime(&self) -> syn::Lifetime {
match *self {
BorrowedLifetimes::Borrowed(_) => syn::Lifetime::new(Term::intern("'de"), Span::call_site()),
BorrowedLifetimes::Static => syn::Lifetime::new(Term::intern("'static"), Span::call_site()),
BorrowedLifetimes::Borrowed(_) => syn::Lifetime::new(Term::new("'de", Span::call_site())),
BorrowedLifetimes::Static => syn::Lifetime::new(Term::new("'static", Span::call_site())),
}
}
@@ -190,7 +190,7 @@ impl BorrowedLifetimes {
match *self {
BorrowedLifetimes::Borrowed(ref bounds) => Some(syn::LifetimeDef {
attrs: Vec::new(),
lifetime: syn::Lifetime::new(Term::intern("'de"), Span::call_site()),
lifetime: syn::Lifetime::new(Term::new("'de", Span::call_site())),
colon_token: None,
bounds: bounds.iter().cloned().collect(),
}),
@@ -2721,7 +2721,7 @@ impl<'a> ToTokens for DeTypeGenerics<'a> {
if self.0.borrowed.de_lifetime_def().is_some() {
let def = syn::LifetimeDef {
attrs: Vec::new(),
lifetime: syn::Lifetime::new(Term::intern("'de"), Span::call_site()),
lifetime: syn::Lifetime::new(Term::new("'de", Span::call_site())),
colon_token: None,
bounds: Punctuated::new(),
};
@@ -2747,7 +2747,7 @@ impl<'a> ToTokens for InPlaceTypeGenerics<'a> {
if self.0.borrowed.de_lifetime_def().is_some() {
let def = syn::LifetimeDef {
attrs: Vec::new(),
lifetime: syn::Lifetime::new(Term::intern("'de"), Span::call_site()),
lifetime: syn::Lifetime::new(Term::new("'de", Span::call_site())),
colon_token: None,
bounds: Punctuated::new(),
};
@@ -2772,7 +2772,7 @@ impl<'a> DeTypeGenerics<'a> {
fn place_lifetime() -> syn::LifetimeDef {
syn::LifetimeDef {
attrs: Vec::new(),
lifetime: syn::Lifetime::new(Term::intern("'place"), Span::call_site()),
lifetime: syn::Lifetime::new(Term::new("'place", Span::call_site())),
colon_token: None,
bounds: Punctuated::new(),
}