mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 01:01:03 +00:00
Globally upgrade to syn 2.x and latest quote and proc_macro2 1x versions (#13846)
* globally upgrade quote to latest 1.0.x (1.0.26) * globally upgrade syn to final 1.0.x version (1.0.109) * globally upgrade proc-macro2 to 1.0.56 * upgrade to syn v2.0.13 and fix everything except NestedMeta * fix parse nested metadata code in decl_runtime_apis.rs * Port more stuff to syn 2.0 * Make the rest compile * Ignore error * update to syn 2.0.14 --------- Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -32,14 +32,14 @@ pub mod keyword {
|
||||
SlashReason(SlashReason),
|
||||
}
|
||||
|
||||
impl Spanned for CompositeKeyword {
|
||||
fn span(&self) -> proc_macro2::Span {
|
||||
impl ToTokens for CompositeKeyword {
|
||||
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
|
||||
use CompositeKeyword::*;
|
||||
match self {
|
||||
FreezeReason(inner) => inner.span(),
|
||||
HoldReason(inner) => inner.span(),
|
||||
LockId(inner) => inner.span(),
|
||||
SlashReason(inner) => inner.span(),
|
||||
FreezeReason(inner) => inner.to_tokens(tokens),
|
||||
HoldReason(inner) => inner.to_tokens(tokens),
|
||||
LockId(inner) => inner.to_tokens(tokens),
|
||||
SlashReason(inner) => inner.to_tokens(tokens),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,14 +109,11 @@ impl CompositeDef {
|
||||
}
|
||||
|
||||
let has_derive_attr = item.attrs.iter().any(|attr| {
|
||||
attr.parse_meta()
|
||||
.ok()
|
||||
.map(|meta| match meta {
|
||||
syn::Meta::List(syn::MetaList { path, .. }) =>
|
||||
path.get_ident().map(|ident| ident == "derive").unwrap_or(false),
|
||||
_ => false,
|
||||
})
|
||||
.unwrap_or(false)
|
||||
if let syn::Meta::List(syn::MetaList { path, .. }) = &attr.meta {
|
||||
path.get_ident().map(|ident| ident == "derive").unwrap_or(false)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
});
|
||||
|
||||
if !has_derive_attr {
|
||||
|
||||
Reference in New Issue
Block a user