Fix storage expansion in pallet section (#6023)
fixes #5320 @sam0x17 @gupnik # Description The issue could be confirmed with the added example. The cause is for macro hygiene, `entries` in the `#( #entries_builder )*` expansion won't be able to reference the `entries` defined outside. The solution here is to allow the reference to be passed into the expansion with closure. Or we could just switch to the unhygienic span with `quote::quote!` instead such that `entries` will resolve to the "outer" definition.
Showing
- prdoc/pr_6023.prdoc 11 additions, 0 deletionsprdoc/pr_6023.prdoc
- substrate/frame/support/procedural/src/pallet/expand/storage.rs 12 additions, 10 deletions...ate/frame/support/procedural/src/pallet/expand/storage.rs
- substrate/frame/support/test/tests/split_ui/pass/split_storage.rs 49 additions, 0 deletions...e/frame/support/test/tests/split_ui/pass/split_storage.rs
- substrate/frame/support/test/tests/split_ui/pass/storage/mod.rs 27 additions, 0 deletions...ate/frame/support/test/tests/split_ui/pass/storage/mod.rs
prdoc/pr_6023.prdoc
0 → 100644
Please register or sign in to comment