We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 888b2b3 + 3027de4 commit 9edb92eCopy full SHA for 9edb92e
1 file changed
crates/syntax/src/lib.rs
@@ -270,12 +270,12 @@ macro_rules! match_ast {
270
(match $node:ident { $($tt:tt)* }) => { $crate::match_ast!(match ($node) { $($tt)* }) };
271
272
(match ($node:expr) {
273
- $( $( $path:ident )::+ ($it:pat) => $res:expr, )*
+ $( $( $path:ident )::+ ($it:pat) $(if $guard:expr)? => $res:expr, )*
274
_ => $catch_all:expr $(,)?
275
}) => {{
276
#[allow(clippy::question_mark, reason = "if `$catch_all` is `return None` Clippy can mark this")]
277
{
278
- $( if let Some($it) = $($path::)+cast($node.clone()) { $res } else )*
+ $( if let Some($it) = $($path::)+cast($node.clone()) $(&& $guard)? { $res } else )*
279
{ $catch_all }
280
}
281
}};
0 commit comments