Fix counting the number of unchangeable arguments in ptr_arg

This commit is contained in:
Jason Newcomb 2022-02-23 01:04:49 -05:00
parent 7f8760a44c
commit 382b3f0601
2 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -186,3 +186,11 @@ pub trait Trait {
fn f(v: &mut Vec<i32>);
fn f2(v: &mut Vec<i32>) {}
}
// Issue #8463
fn two_vecs(a: &mut Vec<u32>, b: &mut Vec<u32>) {
a.push(0);
a.push(0);
a.push(0);
b.push(1);
}