diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index e0ce1b7db003..2c328195f24e 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -547,7 +547,7 @@ fn check_ptr_arg_usage<'tcx>(cx: &LateContext<'tcx>, body: &'tcx Body<'_>, args: // Helper function to handle early returns. let mut set_skip_flag = || { - if result.skip { + if !result.skip { self.skip_count += 1; } result.skip = true; diff --git a/tests/ui/ptr_arg.rs b/tests/ui/ptr_arg.rs index 00b99da2631c..97990fedd51f 100644 --- a/tests/ui/ptr_arg.rs +++ b/tests/ui/ptr_arg.rs @@ -186,3 +186,11 @@ pub trait Trait { fn f(v: &mut Vec); fn f2(v: &mut Vec) {} } + +// Issue #8463 +fn two_vecs(a: &mut Vec, b: &mut Vec) { + a.push(0); + a.push(0); + a.push(0); + b.push(1); +}