mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-16 23:36:13 +00:00
Make more precise range macro upmapping
This commit is contained in:
parent
5fd3688018
commit
45ff51ba22
8 changed files with 81 additions and 81 deletions
|
@ -187,10 +187,10 @@ macro_rules! match_ast {
|
|||
(match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) };
|
||||
|
||||
(match ($node:expr) {
|
||||
$( ast::$ast:ident($it:pat) => $res:expr, )*
|
||||
$( $( $path:ident )::+ ($it:pat) => $res:expr, )*
|
||||
_ => $catch_all:expr $(,)?
|
||||
}) => {{
|
||||
$( if let Some($it) = ast::$ast::cast($node.clone()) { $res } else )*
|
||||
$( if let Some($it) = $($path::)+cast($node.clone()) { $res } else )*
|
||||
{ $catch_all }
|
||||
}};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue