mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 02:52:11 +00:00
fix: make::expr_paren() -> ParenExpr
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
parent
bee999863b
commit
92a7890814
7 changed files with 13 additions and 12 deletions
|
|
@ -659,7 +659,7 @@ pub fn expr_closure(pats: impl IntoIterator<Item = ast::Param>, expr: ast::Expr)
|
|||
pub fn expr_field(receiver: ast::Expr, field: &str) -> ast::Expr {
|
||||
expr_from_text(&format!("{receiver}.{field}"))
|
||||
}
|
||||
pub fn expr_paren(expr: ast::Expr) -> ast::Expr {
|
||||
pub fn expr_paren(expr: ast::Expr) -> ast::ParenExpr {
|
||||
expr_from_text(&format!("({expr})"))
|
||||
}
|
||||
pub fn expr_tuple(elements: impl IntoIterator<Item = ast::Expr>) -> ast::TupleExpr {
|
||||
|
|
|
|||
|
|
@ -328,10 +328,7 @@ impl SyntaxFactory {
|
|||
}
|
||||
|
||||
pub fn expr_paren(&self, expr: ast::Expr) -> ast::ParenExpr {
|
||||
// FIXME: `make::expr_paren` should return a `ParenExpr`, not just an `Expr`
|
||||
let ast::Expr::ParenExpr(ast) = make::expr_paren(expr.clone()).clone_for_update() else {
|
||||
unreachable!()
|
||||
};
|
||||
let ast = make::expr_paren(expr.clone()).clone_for_update();
|
||||
|
||||
if let Some(mut mapping) = self.mappings() {
|
||||
let mut builder = SyntaxMappingBuilder::new(ast.syntax().clone());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue