mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: better handling of SelfParam in inline_call
This commit is contained in:
parent
7c94c29648
commit
d48498f360
2 changed files with 49 additions and 6 deletions
|
@ -595,6 +595,9 @@ pub fn expr_macro_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr {
|
|||
pub fn expr_ref(expr: ast::Expr, exclusive: bool) -> ast::Expr {
|
||||
expr_from_text(&if exclusive { format!("&mut {expr}") } else { format!("&{expr}") })
|
||||
}
|
||||
pub fn expr_reborrow(expr: ast::Expr) -> ast::Expr {
|
||||
expr_from_text(&format!("&mut *{expr}"))
|
||||
}
|
||||
pub fn expr_closure(pats: impl IntoIterator<Item = ast::Param>, expr: ast::Expr) -> ast::Expr {
|
||||
let params = pats.into_iter().join(", ");
|
||||
expr_from_text(&format!("|{params}| {expr}"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue