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.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index ac02cc9e43..95ff3aebd8 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -294,12 +294,7 @@ fn merge_where_clause(
(None, None) => None,
(None, Some(bs)) => Some(bs),
(Some(ps), None) => Some(ps),
- (Some(ps), Some(bs)) => {
- let preds = where_clause(std::iter::empty()).clone_for_update();
- ps.predicates().for_each(|p| preds.add_predicate(p));
- bs.predicates().for_each(|p| preds.add_predicate(p));
- Some(preds)
- }
+ (Some(ps), Some(bs)) => Some(where_clause(ps.predicates().chain(bs.predicates()))),
}
}
@@ -541,9 +536,10 @@ pub fn block_expr(
quote! {
BlockExpr {
StmtList {
- ['{'] "\n"
- #(" " #stmts "\n")*
- #(" " #tail_expr "\n")*
+ ['{']
+ #("\n " #stmts)*
+ #("\n " #tail_expr)*
+ "\n"
['}']
}
}
@@ -877,6 +873,10 @@ pub fn box_pat(pat: ast::Pat) -> ast::BoxPat {
ast_from_text(&format!("fn f(box {pat}: ())"))
}
+pub fn deref_pat(pat: ast::Pat) -> ast::Pat {
+ ast_from_text(&format!("fn f(deref!({pat}): ())"))
+}
+
pub fn paren_pat(pat: ast::Pat) -> ast::ParenPat {
ast_from_text(&format!("fn f(({pat}): ())"))
}