aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src')
-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 c818bba55..4621c9888 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -259,6 +259,10 @@ pub fn token(kind: SyntaxKind) -> SyntaxToken {
259 .unwrap_or_else(|| panic!("unhandled token: {:?}", kind)) 259 .unwrap_or_else(|| panic!("unhandled token: {:?}", kind))
260} 260}
261 261
262pub fn unreachable_macro_call() -> ast::MacroCall {
263 ast_from_text(&format!("unreachable!()"))
264}
265
262fn ast_from_text<N: AstNode>(text: &str) -> N { 266fn ast_from_text<N: AstNode>(text: &str) -> N {
263 let parse = SourceFile::parse(text); 267 let parse = SourceFile::parse(text);
264 let node = parse.tree().syntax().descendants().find_map(N::cast).unwrap(); 268 let node = parse.tree().syntax().descendants().find_map(N::cast).unwrap();