#![doc(hidden)]
#[macro_export]
#[doc(hidden)]
macro_rules! __matches_pattern {
($($t:tt)*) => { $crate::matches_pattern_internal!($($t)*) }
}
#[doc(hidden)]
#[macro_export]
macro_rules! matches_pattern_internal {
(:: $first:tt $($rest:tt)*) => {
$crate::matches_pattern_internal!($first $($rest)*)
};
([$($struct_name:tt)*], { $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(@fwd [], [$($struct_name)*], { $first $($rest)* })
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $field_name:ident : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::__matcher_expr!({$($matcher)*})),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $field_name:ident : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::__matcher_expr!({$($matcher)*})),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $field_name:ident : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::__matcher_expr!([$($matcher)*])),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $field_name:ident : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::__matcher_expr!([$($matcher)*])),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $field_name:ident : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $matcher),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $field_name:ident : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $matcher),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { *$field_name:ident : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*}))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { *$field_name:ident : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*}))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { *$field_name:ident : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*]))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { *$field_name:ident : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*]))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { *$field_name:ident : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::matchers::points_to($matcher)),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { *$field_name:ident : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::field!($($struct_name)*.$field_name, $crate::matchers::points_to($matcher)),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!(dyn $($struct_rest)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::__matcher_expr!({$($matcher)*}),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::__matcher_expr!({$($matcher)*}),).with_custom_definition(stringify!($property_name($($argument),*))),],
[dyn $($struct_rest)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!(dyn $($struct_rest)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::__matcher_expr!([$($matcher)*]),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::__matcher_expr!([$($matcher)*]),).with_custom_definition(stringify!($property_name($($argument),*))),],
[dyn $($struct_rest)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!(dyn $($struct_rest)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $matcher,).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $matcher,).with_custom_definition(stringify!($property_name($($argument),*))),],
[dyn $($struct_rest)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!(dyn $($struct_rest)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*})),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*})),).with_custom_definition(stringify!($property_name($($argument),*))),],
[dyn $($struct_rest)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!(dyn $($struct_rest)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*])),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*])),).with_custom_definition(stringify!($property_name($($argument),*))),],
[dyn $($struct_rest)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!(dyn $($struct_rest)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::matchers::points_to($matcher),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [dyn $($struct_rest:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &(dyn $($struct_rest)* + '_)| s.$property_name($($argument),*), $crate::matchers::points_to($matcher),).with_custom_definition(stringify!($property_name($($argument),*))),],
[dyn $($struct_rest)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::__matcher_expr!({$($matcher)*}),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::__matcher_expr!({$($matcher)*}),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::__matcher_expr!([$($matcher)*]),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::__matcher_expr!([$($matcher)*]),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $matcher,).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $matcher,).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*})),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*})),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*])),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*])),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::matchers::points_to($matcher),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident($($argument:expr),* $(,)?) : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name($($argument),*), $crate::matchers::points_to($matcher),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::__matcher_expr!({$($matcher)*}),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::__matcher_expr!({$($matcher)*}),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::__matcher_expr!([$($matcher)*]),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::__matcher_expr!([$($matcher)*]),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $matcher,).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $matcher,).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : {$($matcher:tt)*} $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*})),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : {$($matcher:tt)*}, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!({$($matcher)*})),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : [$($matcher:tt)*] $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*])),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : [$($matcher:tt)*], $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::matchers::points_to($crate::__matcher_expr!([$($matcher)*])),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : $matcher:expr $(,)? }) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::matchers::points_to($matcher),).with_custom_definition(stringify!($property_name($($argument),*))),)
)
};
(@fwd [$($acc:tt)*], [$($struct_name:tt)*], { * $property_name:ident :: < $($turbofish:ty),* $(,)? > ($($argument:expr),* $(,)?) : $matcher:expr, $first:tt $($rest:tt)* }) => {
$crate::matches_pattern_internal!(
@fwd [$($acc)* $crate::matchers::result_of!(|s: &$($struct_name)*| s.$property_name::<$($turbofish),*>($($argument),*), $crate::matchers::points_to($matcher),).with_custom_definition(stringify!($property_name($($argument),*))),],
[$($struct_name)*], { $first $($rest)* }
)
};
(
[$($struct_name:tt)*],
) => {
$crate::matchers::predicate(|v| matches!(v, $($struct_name)*))
.with_description(
concat!("is ", stringify!($($struct_name)*)),
concat!("is not ", stringify!($($struct_name)*)),
)
};
(
[$($struct_name:tt)*],
({$($matcher:tt)*} $(,)?)
) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($crate::matchers::field!($($struct_name)*.0, $crate::__matcher_expr!({$($matcher)*})))
)
};
(
[$($struct_name:tt)*],
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$crate::matchers::field!($($struct_name)*.0, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
1,
($($rest)*)
)
};
(
[$($struct_name:tt)*],
([$($matcher:tt)*] $(,)?)
) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($crate::matchers::field!($($struct_name)*.0, $crate::__matcher_expr!([$($matcher)*])))
)
};
(
[$($struct_name:tt)*],
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$crate::matchers::field!($($struct_name)*.0, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
1,
($($rest)*)
)
};
(
[$($struct_name:tt)*],
($matcher:expr $(,)?)
) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!($crate::matchers::field!($($struct_name)*.0, $matcher))
)
};
(
[$($struct_name:tt)*],
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$crate::matchers::field!($($struct_name)*.0, $matcher)
),
[$($struct_name)*],
1,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
$field:tt,
({$($matcher:tt)*} $(,)?)
) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.$field, $crate::__matcher_expr!({$($matcher)*}))
),
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
$field:tt,
([$($matcher:tt)*] $(,)?)
) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.$field, $crate::__matcher_expr!([$($matcher)*]))
),
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
1,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.1, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
2,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
1,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.1, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
2,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
2,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.2, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
3,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
2,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.2, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
3,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
3,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.3, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
4,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
3,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.3, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
4,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
4,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.4, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
5,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
4,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.4, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
5,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
5,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.5, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
6,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
5,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.5, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
6,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
6,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.6, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
7,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
6,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.6, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
7,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
7,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.7, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
8,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
7,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.7, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
8,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
8,
({$($matcher:tt)*}, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.8, $crate::__matcher_expr!({$($matcher)*}))
),
[$($struct_name)*],
9,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
8,
([$($matcher:tt)*], $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.8, $crate::__matcher_expr!([$($matcher)*]))
),
[$($struct_name)*],
9,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
$field:tt,
($matcher:expr $(,)?)
) => {
$crate::matchers::__internal::is(
stringify!($($struct_name)*),
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.$field, $matcher)
),
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
1,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.1, $matcher)
),
[$($struct_name)*],
2,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
2,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.2, $matcher)
),
[$($struct_name)*],
3,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
3,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.3, $matcher)
),
[$($struct_name)*],
4,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
4,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.4, $matcher)
),
[$($struct_name)*],
5,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
5,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.5, $matcher)
),
[$($struct_name)*],
6,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
6,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.6, $matcher)
),
[$($struct_name)*],
7,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
7,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.7, $matcher)
),
[$($struct_name)*],
8,
($($rest)*)
)
};
(
$crate::matchers::all!($($processed:tt)*),
[$($struct_name:tt)*],
8,
($matcher:expr, $($rest:tt)*)
) => {
$crate::matches_pattern_internal!(
$crate::matchers::all!(
$($processed)*,
$crate::matchers::field!($($struct_name)*.8, $matcher)
),
[$($struct_name)*],
9,
($($rest)*)
)
};
([$($struct_name:tt)*], $first:tt $($rest:tt)*) => {
$crate::matches_pattern_internal!([$($struct_name)* $first], $($rest)*)
};
($first:tt $($rest:tt)*) => {{
$crate::matches_pattern_internal!([$first], $($rest)*)
}};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __pat {
($($t:tt)*) => { $crate::matches_pattern_internal!($($t)*) }
}