mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add MethodCallExpr::get_or_create_generic_arg_list
Mirrors `PathSegment's` version, except that it always generates a turbofish
This commit is contained in:
parent
3b7c7f97e4
commit
02c7b8b9ba
2 changed files with 26 additions and 1 deletions
|
@ -941,6 +941,13 @@ pub fn lifetime_arg(lifetime: ast::Lifetime) -> ast::LifetimeArg {
|
|||
ast_from_text(&format!("const S: T<{lifetime}> = ();"))
|
||||
}
|
||||
|
||||
pub fn turbofish_generic_arg_list(
|
||||
args: impl IntoIterator<Item = ast::GenericArg>,
|
||||
) -> ast::GenericArgList {
|
||||
let args = args.into_iter().join(", ");
|
||||
ast_from_text(&format!("const S: T::<{args}> = ();"))
|
||||
}
|
||||
|
||||
pub(crate) fn generic_arg_list(
|
||||
args: impl IntoIterator<Item = ast::GenericArg>,
|
||||
) -> ast::GenericArgList {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue