diff options
Diffstat (limited to 'crates/ra_syntax/src/ast/make.rs')
-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 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 | ||
262 | pub fn unreachable_macro_call() -> ast::MacroCall { | ||
263 | ast_from_text(&format!("unreachable!()")) | ||
264 | } | ||
265 | |||
262 | fn ast_from_text<N: AstNode>(text: &str) -> N { | 266 | fn 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(); |