diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index 92ffe0cb0c..deedf0b621 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -379,21 +379,20 @@ macro_rules! parameter_types { } }; ( - $( - $( #[ $attr:meta ] )* - $vis:vis static $name:ident: $type:ty = $value:expr; - )* + $( #[ $attr:meta ] )* + $vis:vis static $name:ident: $type:ty = $value:expr; + $( $rest:tt )* ) => ( $crate::parameter_types_impl_thread_local!( - $( - $( #[ $attr ] )* - $vis static $name: $type = $value; - )* + $( #[ $attr ] )* + $vis static $name: $type = $value; ); + $crate::parameter_types!( $( $rest )* ); ); } #[cfg(not(feature = "std"))] +#[doc(inline)] #[macro_export] macro_rules! parameter_types_impl_thread_local { ( $( $any:tt )* ) => { @@ -402,6 +401,7 @@ macro_rules! parameter_types_impl_thread_local { } #[cfg(feature = "std")] +#[doc(inline)] #[macro_export] macro_rules! parameter_types_impl_thread_local { ( @@ -1217,6 +1217,12 @@ pub mod tests { assert_eq!(300, StorageParameter::get()); }) } + + parameter_types! { + pub const BlockHashCount: u64 = 250; + pub static Members: Vec = vec![]; + pub const Foo: Option = None; + } } /// Prelude to be used alongside pallet macro, for ease of use.