Skip to content

Commit 3fceca2

Browse files
Remove mitigations for incorrect node args
1 parent ac4c209 commit 3fceca2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,12 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
445445
{
446446
let bound_fn_sig = cx.tcx.fn_sig(callee_def_id);
447447
let fn_sig = bound_fn_sig.skip_binder();
448-
if let Some(arg_index) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == expr.hir_id)
448+
if let Some(arg_index) = recv
449+
.into_iter()
450+
.chain(call_args)
451+
.position(|arg| arg.hir_id == expr.hir_id)
449452
&& let param_ty = fn_sig.input(arg_index).skip_binder()
450-
&& let ty::Param(ParamTy { index: param_index , ..}) = *param_ty.kind()
451-
// https://github.com/rust-lang/rust-clippy/issues/9504 and https://github.com/rust-lang/rust-clippy/issues/10021
452-
&& (param_index as usize) < call_generic_args.len()
453+
&& let ty::Param(ParamTy { index: param_index, .. }) = *param_ty.kind()
453454
{
454455
if fn_sig
455456
.skip_binder()

0 commit comments

Comments
 (0)