-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ptr_arg
lint wrongly suggests replacing &mut Vec<_>
parameters with &mut [_]
if the function body uses the Vec
API
#8482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This might be fixed by #8464. Looks like it's the same bug. |
Just checked on the playground and as far as I can tell this no longer occurs. |
I am observing this issue in multiple files in a large project, here for example. We push to that Vec in the function body, so the suggestion is wrong. Clippy version: |
Update to Rust 1.60 extended clippy::ptr_arg somehow and now this triggers a false positive. See rust-lang/rust-clippy#8482 maybe relevant PR: rust-lang/rust-clippy#8271
Update to Rust 1.60 extended clippy::ptr_arg somehow and now this triggers a false positive. See rust-lang/rust-clippy#8482 maybe relevant PR: rust-lang/rust-clippy#8271
I don't think the fix made it into |
This should be fixed in |
Can be closed then? |
Summary
The function in question takes mutable
Vec
s as parameters and modifies them.Lint Name
ptr_arg
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen: Lint doesn't trigger
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: