From 29f75208dcfdfd4355a089d17e6fa874fd6e7878 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Wed, 8 Mar 2023 18:57:16 -0500 Subject: [PATCH] generics fix for dispatchables --- frame/support/procedural/src/pallet/expand/doc_only.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frame/support/procedural/src/pallet/expand/doc_only.rs b/frame/support/procedural/src/pallet/expand/doc_only.rs index ce1f5cb14dcc2..4c107d5548eb5 100644 --- a/frame/support/procedural/src/pallet/expand/doc_only.rs +++ b/frame/support/procedural/src/pallet/expand/doc_only.rs @@ -15,6 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +use proc_macro2::Span; + use crate::pallet::Def; pub fn expand_doc_only(def: &mut Def) -> proc_macro2::TokenStream { @@ -45,6 +47,8 @@ pub fn expand_doc_only(def: &mut Def) -> proc_macro2::TokenStream { } }; + let type_impl_generics = def.type_impl_generics(Span::call_site()); + quote::quote!( #[cfg(doc)] pub mod storage_types { @@ -56,7 +60,10 @@ pub fn expand_doc_only(def: &mut Def) -> proc_macro2::TokenStream { #[cfg(doc)] pub mod dispatchables { use super::*; - #dispatchables + pub struct Dispatchables; + impl<#type_impl_generics> Dispatchables { + #dispatchables + } } ) }