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:
Sam Johnson
2023-04-12 14:42:22 -04:00
committed by GitHub
parent 03c99fe003
commit b83bf4784e
62 changed files with 402 additions and 478 deletions
@@ -133,14 +133,13 @@ impl GenesisConfigDef {
.attrs
.iter()
.map(|attr| {
let meta = attr.parse_meta()?;
if meta.path().is_ident("cfg") {
if attr.meta.path().is_ident("cfg") {
return Err(syn::Error::new(
meta.span(),
attr.meta.span(),
"extra genesis config items do not support `cfg` attribute",
))
}
Ok(meta)
Ok(attr.meta.clone())
})
.collect::<syn::Result<_>>()?;
@@ -332,8 +332,8 @@ impl StorageLineDefExt {
let doc_attrs = storage_def
.attrs
.iter()
.filter_map(|a| a.parse_meta().ok())
.filter(|m| m.path().is_ident("doc"))
.filter(|a| a.meta.path().is_ident("doc"))
.map(|a| a.meta.clone())
.collect();
Self {
@@ -273,14 +273,12 @@ pub fn maybe_print_pallet_upgrade(def: &super::DeclStorageDefExt) {
doc = line.doc_attrs.iter().fold(String::new(), |mut res, attr| {
if let syn::Meta::NameValue(name_value) = attr {
if name_value.path.is_ident("doc") {
if let syn::Lit::Str(string) = &name_value.lit {
res = format!(
"{}
///{}",
res,
string.value(),
);
}
res = format!(
"{}
///{}",
res,
name_value.value.to_token_stream(),
);
}
}
res