Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/make.rs')
-rw-r--r--crates/syntax/src/ast/make.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index 812b0dc888..9d84d060c3 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -63,6 +63,9 @@ pub mod ext {
Some(expr)
}
+ pub fn expr_unit() -> ast::Expr {
+ expr_tuple([]).into()
+ }
pub fn expr_unreachable() -> ast::Expr {
expr_from_text("unreachable!()")
}
@@ -546,10 +549,6 @@ pub fn hacky_block_expr(
ast_from_text(&format!("fn f() {buf}"))
}
-pub fn expr_unit() -> ast::Expr {
- expr_from_text("()")
-}
-
pub fn expr_literal(text: &str) -> ast::Literal {
assert_eq!(text.trim(), text);
ast_from_text(&format!("fn f() {{ let _ = {text}; }}"))