mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 15:07:59 +00:00
pallet-macro: Ensure that building with missing_docs works (#11075)
* pallet-macro: Ensure that building with `missing_docs` works Before this pr it was failing when compiling with `missing_docs`, because the macro was generating functions etc without the appropriate docs. In the case of this pr it is mainly about hiding these functions in the docs as they are internal api anyway. * Fix UI test
This commit is contained in:
@@ -178,7 +178,10 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
#(
|
||||
#( #[doc = #fn_doc] )*
|
||||
#fn_name {
|
||||
#( #args_compact_attr #args_name_stripped: #args_type ),*
|
||||
#(
|
||||
#[allow(missing_docs)]
|
||||
#args_compact_attr #args_name_stripped: #args_type
|
||||
),*
|
||||
},
|
||||
)*
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ pub fn expand_error(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
}
|
||||
|
||||
impl<#type_impl_gen> #error_ident<#type_use_gen> #config_where_clause {
|
||||
#[doc(hidden)]
|
||||
pub fn as_u8(&self) -> u8 {
|
||||
match &self {
|
||||
Self::__Ignore(_, _) => unreachable!("`__Ignore` can never be constructed"),
|
||||
@@ -97,6 +98,7 @@ pub fn expand_error(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
match &self {
|
||||
Self::__Ignore(_, _) => unreachable!("`__Ignore` can never be constructed"),
|
||||
|
||||
@@ -81,6 +81,7 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
let error_ident = &error_def.error;
|
||||
quote::quote_spanned!(def.pallet_struct.attr_span =>
|
||||
impl<#type_impl_gen> #pallet_ident<#type_use_gen> #config_where_clause {
|
||||
#[doc(hidden)]
|
||||
pub fn error_metadata() -> Option<#frame_support::metadata::PalletErrorMetadata> {
|
||||
Some(#frame_support::metadata::PalletErrorMetadata {
|
||||
ty: #frame_support::scale_info::meta_type::<#error_ident<#type_use_gen>>()
|
||||
@@ -91,6 +92,7 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
} else {
|
||||
quote::quote_spanned!(def.pallet_struct.attr_span =>
|
||||
impl<#type_impl_gen> #pallet_ident<#type_use_gen> #config_where_clause {
|
||||
#[doc(hidden)]
|
||||
pub fn error_metadata() -> Option<#frame_support::metadata::PalletErrorMetadata> {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -406,6 +406,7 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
|
||||
quote::quote_spanned!(storage_def.attr_span =>
|
||||
#(#cfg_attrs)*
|
||||
#[doc(hidden)]
|
||||
#prefix_struct_vis struct #counter_prefix_struct_ident<#type_use_gen>(
|
||||
core::marker::PhantomData<(#type_use_gen,)>
|
||||
);
|
||||
@@ -439,6 +440,7 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
#maybe_counter
|
||||
|
||||
#(#cfg_attrs)*
|
||||
#[doc(hidden)]
|
||||
#prefix_struct_vis struct #prefix_struct_ident<#type_use_gen>(
|
||||
core::marker::PhantomData<(#type_use_gen,)>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user