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
@@ -16,6 +16,6 @@ proc-macro = true
[dependencies]
proc-macro-crate = "1.1.3"
proc-macro2 = "1.0.37"
quote = "1.0.10"
syn = "1.0.98"
proc-macro2 = "1.0.56"
quote = "1.0.26"
syn = "2.0.14"
@@ -35,7 +35,7 @@ pub fn extension_derive(ast: &DeriveInput) -> proc_macro::TokenStream {
.named
.iter()
.find_map(|f| {
if f.attrs.iter().any(|attr| attr.path.is_ident(ATTRIBUTE_NAME)) {
if f.attrs.iter().any(|attr| attr.path().is_ident(ATTRIBUTE_NAME)) {
let typ = &f.ty;
Some(quote! { #typ })
} else {
+3 -2
View File
@@ -556,8 +556,9 @@ fn aux_storage_cleanup<C: HeaderMetadata<Block> + HeaderBackend<Block>, Block: B
Ok(meta) => {
hashes.insert(meta.parent);
},
Err(err) =>
warn!(target: LOG_TARGET, "Failed to lookup metadata for block `{:?}`: {}", first, err,),
Err(err) => {
warn!(target: LOG_TARGET, "Failed to lookup metadata for block `{:?}`: {}", first, err,)
},
}
// Cleans data for finalized block's ancestors
@@ -149,8 +149,9 @@ impl<Block: BlockT> PinnedBlocksCache<Block> {
self.cache.len()
);
},
None =>
log::warn!(target: LOG_TARGET, "Unable to bump reference count. hash = {}", hash),
None => {
log::warn!(target: LOG_TARGET, "Unable to bump reference count. hash = {}", hash)
},
};
}
@@ -158,8 +158,9 @@ fn finality_notification_check(
assert_eq!(notif.hash, *finalized.last().unwrap());
assert_eq!(stale_heads, stale_heads_expected);
},
Err(TryRecvError::Closed) =>
panic!("unexpected notification result, client send channel was closed"),
Err(TryRecvError::Closed) => {
panic!("unexpected notification result, client send channel was closed")
},
Err(TryRecvError::Empty) => assert!(finalized.is_empty()),
}
}
+6 -4
View File
@@ -187,12 +187,14 @@ impl fmt::Debug for StateDbError {
"Incompatible pruning modes [stored: {:?}; requested: {:?}]",
stored, requested
),
Self::TooManySiblingBlocks { number } =>
write!(f, "Too many sibling blocks at #{number} inserted"),
Self::TooManySiblingBlocks { number } => {
write!(f, "Too many sibling blocks at #{number} inserted")
},
Self::BlockAlreadyExists => write!(f, "Block already exists"),
Self::Metadata(message) => write!(f, "Invalid metadata: {}", message),
Self::BlockUnavailable =>
write!(f, "Trying to get a block record from db while it is not commit to db yet"),
Self::BlockUnavailable => {
write!(f, "Trying to get a block record from db while it is not commit to db yet")
},
Self::BlockMissing => write!(f, "Block record is missing from the pruning window"),
}
}
@@ -16,6 +16,6 @@ proc-macro = true
[dependencies]
proc-macro-crate = "1.1.3"
proc-macro2 = "1.0.37"
quote = { version = "1.0.10", features = ["proc-macro"] }
syn = { version = "1.0.98", features = ["proc-macro", "full", "extra-traits", "parsing"] }
proc-macro2 = "1.0.56"
quote = { version = "1.0.26", features = ["proc-macro"] }
syn = { version = "2.0.14", features = ["proc-macro", "full", "extra-traits", "parsing"] }