diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index ffc874a10..2cc9ff153 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -249,6 +249,10 @@ pub fn token(kind: SyntaxKind) -> SyntaxToken { | |||
249 | .unwrap_or_else(|| panic!("unhandled token: {:?}", kind)) | 249 | .unwrap_or_else(|| panic!("unhandled token: {:?}", kind)) |
250 | } | 250 | } |
251 | 251 | ||
252 | pub fn unreachable_macro_call() -> ast::MacroCall { | ||
253 | ast_from_text(&format!("unreachable!()")) | ||
254 | } | ||
255 | |||
252 | fn ast_from_text<N: AstNode>(text: &str) -> N { | 256 | fn ast_from_text<N: AstNode>(text: &str) -> N { |
253 | let parse = SourceFile::parse(text); | 257 | let parse = SourceFile::parse(text); |
254 | let node = parse.tree().syntax().descendants().find_map(N::cast).unwrap(); | 258 | let node = parse.tree().syntax().descendants().find_map(N::cast).unwrap(); |