mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 09:41:02 +00:00
Update to syn/quote/proc-macro2 new apis
This commit is contained in:
@@ -23,10 +23,10 @@ name = "serde_derive"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.2"
|
||||
quote = "0.4"
|
||||
proc-macro2 = "0.3"
|
||||
quote = "0.5"
|
||||
serde_derive_internals = { version = "=0.22.2", default-features = false, path = "../serde_derive_internals" }
|
||||
syn = { version = "0.12", features = ["visit"] }
|
||||
syn = { version = "0.13", features = ["visit"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = { version = "1.0", path = "../serde" }
|
||||
|
||||
@@ -249,7 +249,7 @@ pub fn with_self_bound(
|
||||
}
|
||||
|
||||
pub fn with_lifetime_bound(generics: &syn::Generics, lifetime: &str) -> syn::Generics {
|
||||
let bound = syn::Lifetime::new(Term::intern(lifetime), Span::call_site());
|
||||
let bound = syn::Lifetime::new(Term::new(lifetime, Span::call_site()));
|
||||
let def = syn::LifetimeDef {
|
||||
attrs: Vec::new(),
|
||||
lifetime: bound,
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user