mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 02:52:11 +00:00
fix: make::expr_method_call() -> MethodCallExpr
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
parent
728d72fbe1
commit
ab620e367d
7 changed files with 27 additions and 27 deletions
|
|
@ -640,7 +640,7 @@ pub fn expr_method_call(
|
|||
receiver: ast::Expr,
|
||||
method: ast::NameRef,
|
||||
arg_list: ast::ArgList,
|
||||
) -> ast::Expr {
|
||||
) -> ast::MethodCallExpr {
|
||||
expr_from_text(&format!("{receiver}.{method}{arg_list}"))
|
||||
}
|
||||
pub fn expr_macro_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr {
|
||||
|
|
|
|||
|
|
@ -423,13 +423,8 @@ impl SyntaxFactory {
|
|||
method: ast::NameRef,
|
||||
arg_list: ast::ArgList,
|
||||
) -> ast::MethodCallExpr {
|
||||
// FIXME: `make::expr_method_call` should return a `MethodCallExpr`, not just an `Expr`
|
||||
let ast::Expr::MethodCallExpr(ast) =
|
||||
make::expr_method_call(receiver.clone(), method.clone(), arg_list.clone())
|
||||
.clone_for_update()
|
||||
else {
|
||||
unreachable!()
|
||||
};
|
||||
let ast = make::expr_method_call(receiver.clone(), method.clone(), arg_list.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