Make sure docs given to decl_module! are passed to the module struct (#4526)

This commit is contained in:
Bastian Köcher
2020-01-03 21:39:30 +01:00
committed by Gavin Wood
parent a45aa6e1b6
commit f02e6d680a
3 changed files with 39 additions and 13 deletions
+4 -9
View File
@@ -1075,7 +1075,6 @@ macro_rules! decl_module {
// Declare a `Call` variant parameter that should be encoded `compact`.
(@create_call_enum
$( #[$attr:meta] )*
$call_type:ident;
<$trait_instance:ident: $trait_name:ident$(<I>, $instance:ident: $instantiable:path $(= $module_default_instance:path)?)?>
{ $( $other_where_bounds:tt )* }
@@ -1089,7 +1088,6 @@ macro_rules! decl_module {
) => {
$crate::decl_module! {
@create_call_enum
$( #[$attr] )*
$call_type;
<$trait_instance: $trait_name $(<I>, $instance: $instantiable $(= $module_default_instance)? )?>
{ $( $other_where_bounds )* }
@@ -1107,7 +1105,6 @@ macro_rules! decl_module {
// Declare a `Call` variant parameter.
(@create_call_enum
$( #[$attr:meta] )*
$call_type:ident;
<$trait_instance:ident: $trait_name:ident$(<I>, $instance:ident: $instantiable:path $(= $module_default_instance:path)?)?>
{ $( $other_where_bounds:tt )* }
@@ -1120,7 +1117,6 @@ macro_rules! decl_module {
) => {
$crate::decl_module! {
@create_call_enum
$( #[$attr] )*
$call_type;
<$trait_instance: $trait_name $(<I>, $instance: $instantiable $(= $module_default_instance)? )?>
{ $( $other_where_bounds )* }
@@ -1136,7 +1132,6 @@ macro_rules! decl_module {
};
(@create_call_enum
$( #[$attr:meta] )*
$call_type:ident;
<$trait_instance:ident: $trait_name:ident$(<I>, $instance:ident: $instantiable:path $(= $module_default_instance:path)?)?>
{ $( $other_where_bounds:tt )* }
@@ -1151,7 +1146,6 @@ macro_rules! decl_module {
) => {
$crate::decl_module! {
@create_call_enum
$( #[$attr] )*
$call_type;
<$trait_instance: $trait_name $(<I>, $instance: $instantiable $(= $module_default_instance)? )?>
{ $( $other_where_bounds )* }
@@ -1172,15 +1166,16 @@ macro_rules! decl_module {
};
(@create_call_enum
$( #[$attr:meta] )*
$call_type:ident;
<$trait_instance:ident: $trait_name:ident$(<I>, $instance:ident: $instantiable:path $(= $module_default_instance:path)?)?>
{ $( $other_where_bounds:tt )* }
{ $( $generated_variants:tt )* }
{}
) => {
/// Dispatchable calls.
///
/// Each variant of this enum maps to a dispatchable function from the associated module.
#[derive($crate::codec::Encode, $crate::codec::Decode)]
$( #[$attr] )*
pub enum $call_type<$trait_instance: $trait_name$(<I>, $instance: $instantiable $( = $module_default_instance)?)?>
where $( $other_where_bounds )*
{
@@ -1221,6 +1216,7 @@ macro_rules! decl_module {
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, Copy, PartialEq, Eq, $crate::RuntimeDebug)]
$( #[$attr] )*
pub struct $mod_type<
$trait_instance: $trait_name
$(<I>, $instance: $instantiable $( = $module_default_instance)?)?
@@ -1286,7 +1282,6 @@ macro_rules! decl_module {
$crate::decl_module! {
@create_call_enum
$( #[$attr] )*
$call_type;
<$trait_instance: $trait_name $(<I>, $instance: $instantiable $(= $module_default_instance)? )?>
{ $( $other_where_bounds )* }