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