aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-15 23:12:59 +0000
committerGitHub <noreply@github.com>2019-11-15 23:12:59 +0000
commitd9d99369b2765eaef7f49cd519990769191c3381 (patch)
tree5685e9db16e4a35c7ff3158d5c09becf9a45b31d /crates/ra_syntax/src
parent69f3b01dc5dd70d9bdf6de4d859ad593a689395d (diff)
parentd898ecb8f2c19eb041bcb27c7ce9edd9d891f2c2 (diff)
Merge #2271
2271: Force passing Source when creating a SourceAnalyzer r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 5dcb6a95a..9931fec84 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -176,9 +176,11 @@ impl SourceFile {
176/// ``` 176/// ```
177#[macro_export] 177#[macro_export]
178macro_rules! match_ast { 178macro_rules! match_ast {
179 (match $node:ident { 179 (match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) };
180
181 (match ($node:expr) {
180 $( ast::$ast:ident($it:ident) => $res:block, )* 182 $( ast::$ast:ident($it:ident) => $res:block, )*
181 _ => $catch_all:expr, 183 _ => $catch_all:expr $(,)?
182 }) => {{ 184 }) => {{
183 $( if let Some($it) = ast::$ast::cast($node.clone()) $res else )* 185 $( if let Some($it) = ast::$ast::cast($node.clone()) $res else )*
184 { $catch_all } 186 { $catch_all }