mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
uninlined_format_args: do not inline argument with generic parameters
This commit is contained in:
parent
0e40f94a86
commit
75aa2b9ec8
3 changed files with 9 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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::<()>);
|
||||||
|
}
|
||||||
|
|
|
@ -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::<()>);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue