Skip to content

Commit e329249

Browse files
committed
Auto merge of rust-lang#8464 - Jarcho:ptr_arg_8463, r=camsteffen
Fix `ptr_arg` fixes: rust-lang#8463 changelog: Fix `ptr_arg` when multiple arguments are being checked in one function
2 parents 2c8d5a2 + 382b3f0 commit e329249

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

clippy_lints/src/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ fn check_ptr_arg_usage<'tcx>(cx: &LateContext<'tcx>, body: &'tcx Body<'_>, args:
547547

548548
// Helper function to handle early returns.
549549
let mut set_skip_flag = || {
550-
if result.skip {
550+
if !result.skip {
551551
self.skip_count += 1;
552552
}
553553
result.skip = true;

tests/ui/ptr_arg.rs

+8
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,11 @@ pub trait Trait {
186186
fn f(v: &mut Vec<i32>);
187187
fn f2(v: &mut Vec<i32>) {}
188188
}
189+
190+
// Issue #8463
191+
fn two_vecs(a: &mut Vec<u32>, b: &mut Vec<u32>) {
192+
a.push(0);
193+
a.push(0);
194+
a.push(0);
195+
b.push(1);
196+
}

0 commit comments

Comments
 (0)