#[doc(hidden)]
#[macro_export]
macro_rules! _CONST {
(
// Either multiple `const fn`
$(
$(#[$CONST_ATTRS:meta])*
$item_vis:vis $CONST_NAME:ident =
$(#[$fn_attrs:meta])*
$fn_vis:vis const
$(async$($_a:block)?)? $(safe$($_s:block)?)? $(unsafe$($_u:block)?)?
fn $fn:ident($($param:ident: $param_ty:ty),* $(,)?)
$(-> $fn_return:ty)?
$fn_body:block
);* $(;)?) => {
$(
$(#[$CONST_ATTRS])*
#[allow(unused_macros)]
macro_rules! $CONST_NAME {
() => {
$(#[$fn_attrs])*
$fn_vis const $(async$($_a)?)? $(safe$($_s)?)? $(unsafe$($_u)?)?
fn $fn($($param: $param_ty),*) $(-> $fn_return)? $fn_body
}
}
$item_vis use $CONST_NAME;
)*
};
(
$shared_vis:vis, $(
$(#[$CONST_ATTRS:meta])*
$CONST_NAME:ident =
$(#[$fn_attrs:meta])*
$fn_vis:vis const
$(async$($_a:block)?)? $(safe$($_s:block)?)? $(unsafe$($_u:block)?)?
fn $fn:ident($($param:ident: $param_ty:ty),* $(,)?)
$(-> $fn_return:ty)?
$fn_body:block
);* $(;)?) => {
$(
$(#[$CONST_ATTRS])*
#[allow(unused_macros)]
macro_rules! $CONST_NAME {
() => {
$(#[$fn_attrs])*
$shared_vis const $(async$($_a)?)? $(safe$($_s)?)? $(unsafe$($_u)?)?
fn $fn($($param: $param_ty),*) $(-> $fn_return)? $fn_body
}
}
$shared_vis use $CONST_NAME;
)*
};
(
$(
$(#[$CONST_ATTRS:meta])*
$item_vis:vis $CONST_NAME:ident = $expr:expr
);* $(;)?) => {
$(
$(#[$CONST_ATTRS])*
#[allow(unused_macro)]
macro_rules! $CONST_NAME { () => { $expr } }
$item_vis use $CONST_NAME;
)*
};
(
$shared_vis:vis, $(
$(#[$CONST_ATTRS:meta])*
$CONST_NAME:ident = $expr:expr
);* $(;)?) => {
$(
$(#[$CONST_ATTRS])*
#[allow(unused_macro)]
macro_rules! $CONST_NAME { () => { $expr } }
$shared_vis use $CONST_NAME;
)*
};
}
#[doc(inline)]
pub use _CONST as CONST;