uninlined_format_args: do not inline argument with generic parameters

This commit is contained in:
Samuel Tardieu 2023-02-13 20:41:26 +01:00
parent 0e40f94a86
commit 75aa2b9ec8
3 changed files with 9 additions and 0 deletions

View file

@ -340,6 +340,7 @@ fn check_one_arg(
if matches!(param.kind, Implicit | Starred | Named(_) | Numbered) if matches!(param.kind, Implicit | Starred | Named(_) | Numbered)
&& let ExprKind::Path(QPath::Resolved(None, path)) = param.value.kind && let ExprKind::Path(QPath::Resolved(None, path)) = param.value.kind
&& let [segment] = path.segments && let [segment] = path.segments
&& segment.args.is_none()
&& let Some(arg_span) = args.value_with_prev_comma_span(param.value.hir_id) && let Some(arg_span) = args.value_with_prev_comma_span(param.value.hir_id)
{ {
let replacement = match param.usage { let replacement = match param.usage {

View file

@ -174,3 +174,7 @@ fn _meets_msrv() {
let local_i32 = 1; let local_i32 = 1;
println!("expand='{local_i32}'"); println!("expand='{local_i32}'");
} }
fn _do_not_fire() {
println!("{:?}", None::<()>);
}

View file

@ -179,3 +179,7 @@ fn _meets_msrv() {
let local_i32 = 1; let local_i32 = 1;
println!("expand='{}'", local_i32); println!("expand='{}'", local_i32);
} }
fn _do_not_fire() {
println!("{:?}", None::<()>);
}