upgrade to macro_magic 0.4.3 (#1832)

# Description

Upgrades `macro_magic` to 0.4.3, which introduces the ability to have
`export_tokens` use the same name as the underlying item for its
auto-generated macro name. Ultimately this will allow for better dev ux
in our derive_impl feature.
This commit is contained in:
Sam Johnson
2023-10-10 13:48:50 -04:00
committed by GitHub
parent 3f5edc52b2
commit 5adcb3e106
4 changed files with 17 additions and 12 deletions
Generated
+8 -8
View File
@@ -7616,9 +7616,9 @@ dependencies = [
[[package]]
name = "macro_magic"
version = "0.4.2"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9"
checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d"
dependencies = [
"macro_magic_core",
"macro_magic_macros",
@@ -7628,9 +7628,9 @@ dependencies = [
[[package]]
name = "macro_magic_core"
version = "0.4.2"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00"
checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d"
dependencies = [
"const-random",
"derive-syn-parse",
@@ -7642,9 +7642,9 @@ dependencies = [
[[package]]
name = "macro_magic_core_macros"
version = "0.4.2"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b"
checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654"
dependencies = [
"proc-macro2",
"quote",
@@ -7653,9 +7653,9 @@ dependencies = [
[[package]]
name = "macro_magic_macros"
version = "0.4.2"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a"
checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3"
dependencies = [
"macro_magic_core",
"quote",
+1 -1
View File
@@ -30,7 +30,7 @@ sp-weights = { path = "../../primitives/weights", default-features = false}
sp-debug-derive = { path = "../../primitives/debug-derive", default-features = false}
sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = false}
tt-call = "1.0.8"
macro_magic = "0.4.2"
macro_magic = "0.5.0"
frame-support-procedural = { path = "procedural", default-features = false}
paste = "1.0"
sp-state-machine = { path = "../../primitives/state-machine", default-features = false, optional = true}
@@ -23,8 +23,8 @@ proc-macro2 = "1.0.56"
quote = "1.0.28"
syn = { version = "2.0.38", features = ["full"] }
frame-support-procedural-tools = { path = "tools" }
macro_magic = { version = "0.5.0", features = ["proc_support"] }
proc-macro-warning = { version = "1.0.0", default-features = false }
macro_magic = { version = "0.4.2", features = ["proc_support"] }
expander = "2.0.0"
sp-core-hashing = { path = "../../../primitives/core/hashing" }
@@ -864,7 +864,12 @@ pub fn register_default_impl(attrs: TokenStream, tokens: TokenStream) -> TokenSt
let item_impl = syn::parse_macro_input!(tokens as ItemImpl);
// internally wrap macro_magic's `#[export_tokens]` macro
match macro_magic::mm_core::export_tokens_internal(attrs, item_impl.to_token_stream(), true) {
match macro_magic::mm_core::export_tokens_internal(
attrs,
item_impl.to_token_stream(),
true,
true,
) {
Ok(tokens) => tokens.into(),
Err(err) => err.to_compile_error().into(),
}
@@ -1565,7 +1570,7 @@ pub fn pallet_section(attr: TokenStream, tokens: TokenStream) -> TokenStream {
let _mod = parse_macro_input!(tokens_clone as ItemMod);
// use macro_magic's export_tokens as the internal implementation otherwise
match macro_magic::mm_core::export_tokens_internal(attr, tokens, false) {
match macro_magic::mm_core::export_tokens_internal(attr, tokens, false, true) {
Ok(tokens) => tokens.into(),
Err(err) => err.to_compile_error().into(),
}