Auto merge of #10343 - samueltardieu:issue-10339, r=Alexendoo

uninlined_format_args: do not inline argument with generic parameters

Fix #10339

---

changelog: FP: [`uninlined_format_args`]: No longer lints for arguments with generic parameters
[#10343](https://github.com/rust-lang/rust-clippy/pull/10343)
<!-- changelog_checked -->
This commit is contained in:
bors 2023-02-15 13:35:49 +00:00
commit 8754d5a6fb
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)
&& let ExprKind::Path(QPath::Resolved(None, path)) = param.value.kind
&& let [segment] = path.segments
&& segment.args.is_none()
&& let Some(arg_span) = args.value_with_prev_comma_span(param.value.hir_id)
{
let replacement = match param.usage {

View File

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

View File

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