mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-18 17:40:29 +00:00
match_ast!
takes a pattern to allow underscore usage
This commit is contained in:
parent
9915103c9e
commit
901c7c7277
6 changed files with 35 additions and 35 deletions
|
@ -242,7 +242,7 @@ macro_rules! match_ast {
|
|||
(match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) };
|
||||
|
||||
(match ($node:expr) {
|
||||
$( ast::$ast:ident($it:ident) => $res:expr, )*
|
||||
$( ast::$ast:ident($it:pat) => $res:expr, )*
|
||||
_ => $catch_all:expr $(,)?
|
||||
}) => {{
|
||||
$( if let Some($it) = ast::$ast::cast($node.clone()) { $res } else )*
|
||||
|
|
|
@ -275,7 +275,7 @@ fn validate_path_keywords(segment: ast::PathSegment, errors: &mut Vec<SyntaxErro
|
|||
return Some(tree_path);
|
||||
}
|
||||
},
|
||||
ast::UseTreeList(_it) => continue,
|
||||
ast::UseTreeList(_) => continue,
|
||||
ast::Path(parent) => path = parent,
|
||||
_ => return None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue