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 1145b69e8..e29600439 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -250,6 +250,10 @@ pub fn token(kind: SyntaxKind) -> SyntaxToken {
250 .unwrap_or_else(|| panic!("unhandled token: {:?}", kind)) 250 .unwrap_or_else(|| panic!("unhandled token: {:?}", kind))
251} 251}
252 252
253pub fn unreachable_macro_call() -> ast::MacroCall {
254 ast_from_text(&format!("unreachable!()"))
255}
256
253fn ast_from_text<N: AstNode>(text: &str) -> N { 257fn ast_from_text<N: AstNode>(text: &str) -> N {
254 let parse = SourceFile::parse(text); 258 let parse = SourceFile::parse(text);
255 let node = parse.tree().syntax().descendants().find_map(N::cast).unwrap(); 259 let node = parse.tree().syntax().descendants().find_map(N::cast).unwrap();