Skip to content

Commit 5adcb3e

Browse files
authored
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.
1 parent 3f5edc5 commit 5adcb3e

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

substrate/frame/support/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sp-weights = { path = "../../primitives/weights", default-features = false}
3030
sp-debug-derive = { path = "../../primitives/debug-derive", default-features = false}
3131
sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = false}
3232
tt-call = "1.0.8"
33-
macro_magic = "0.4.2"
33+
macro_magic = "0.5.0"
3434
frame-support-procedural = { path = "procedural", default-features = false}
3535
paste = "1.0"
3636
sp-state-machine = { path = "../../primitives/state-machine", default-features = false, optional = true}

substrate/frame/support/procedural/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ proc-macro2 = "1.0.56"
2323
quote = "1.0.28"
2424
syn = { version = "2.0.38", features = ["full"] }
2525
frame-support-procedural-tools = { path = "tools" }
26+
macro_magic = { version = "0.5.0", features = ["proc_support"] }
2627
proc-macro-warning = { version = "1.0.0", default-features = false }
27-
macro_magic = { version = "0.4.2", features = ["proc_support"] }
2828
expander = "2.0.0"
2929
sp-core-hashing = { path = "../../../primitives/core/hashing" }
3030

substrate/frame/support/procedural/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,12 @@ pub fn register_default_impl(attrs: TokenStream, tokens: TokenStream) -> TokenSt
864864
let item_impl = syn::parse_macro_input!(tokens as ItemImpl);
865865

866866
// internally wrap macro_magic's `#[export_tokens]` macro
867-
match macro_magic::mm_core::export_tokens_internal(attrs, item_impl.to_token_stream(), true) {
867+
match macro_magic::mm_core::export_tokens_internal(
868+
attrs,
869+
item_impl.to_token_stream(),
870+
true,
871+
true,
872+
) {
868873
Ok(tokens) => tokens.into(),
869874
Err(err) => err.to_compile_error().into(),
870875
}
@@ -1565,7 +1570,7 @@ pub fn pallet_section(attr: TokenStream, tokens: TokenStream) -> TokenStream {
15651570
let _mod = parse_macro_input!(tokens_clone as ItemMod);
15661571

15671572
// use macro_magic's export_tokens as the internal implementation otherwise
1568-
match macro_magic::mm_core::export_tokens_internal(attr, tokens, false) {
1573+
match macro_magic::mm_core::export_tokens_internal(attr, tokens, false, true) {
15691574
Ok(tokens) => tokens.into(),
15701575
Err(err) => err.to_compile_error().into(),
15711576
}

0 commit comments

Comments
 (0)