aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/make.rs4
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
252pub fn unreachable_macro_call() -> ast::MacroCall {
253 ast_from_text(&format!("unreachable!()"))
254}
255
252fn ast_from_text<N: AstNode>(text: &str) -> N { 256fn 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();