crate::utils::cfg_match! {
feature = "fn_traits" => (
dispatch! {$
fn_traits = true
}
);
_ => (
dispatch! {$
fn_traits = false
}
);
}
macro_rules! dispatch {($_:tt
fn_traits =
$(true $($if_cfg_fn_traits:tt)?)?
$(false $($if_not_cfg_fn_traits:tt)?)?
) => (
/// Produce <code>impl [ForLt]</code>[^auto] types _on demand_.
///
/// [ForLt]: trait@crate::ForLt
/// [^auto]: `+ Send + Sync + Unpin`
///
/// ### Syntax
///
/// - #### Full syntax
///
/// ```rust
/// # use ::higher_kinded_types::ForLt;
/// # mod some { pub use ::std::borrow::Cow as Arbitrary; }
/// # use str as Type; let _:
/// ForLt!(<'r> = some::Arbitrary<'r, Type>)
#[macro_export] #[doc(hidden)]
macro_rules! ඞForLt {
(
// Named lifetime case: e.g. `ForLt!(<'r> = &'r str)`.
<$lt:lifetime> = $T:ty $_(,)?
) => (
$($($if_cfg_fn_traits)?
$_ crate::ඞ::ForLt<
for<$lt> fn($_ crate::ඞ::__<$lt>) -> $T
>
)?
$($($if_not_cfg_fn_traits)?
$_ crate::ඞ::ForLt<
dyn for<$lt> $_ crate::advanced::WithLifetime<$lt, Of = $T>,
>
)?
);
(
// default case: as if we had `ForLt!(<'_> = $($input)*)`.
$_($shorthand_syntax:tt)*
) => (
$($($if_cfg_fn_traits)?
$_ crate::ඞ::ForLt<
fn($_ crate::ඞ::r#for<'_>) -> $_($shorthand_syntax)*
>
)?
$($($if_not_cfg_fn_traits)?
$_ crate::ForLt! {
<'ඞ /* ' */> = $_ crate::ඞForLt_munch! {
[output: ]
[input: $_($shorthand_syntax)*]
[mode: default]
}
}
)?
);
}
#[doc(inline)]
pub use ඞForLt as ForLt;
)}
use dispatch;