-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Check usages in ptr_arg
#8271
Check usages in ptr_arg
#8271
Conversation
* Track the argument when used to initialize simple `let` bindings * Check if the argument is passed to a function requiring the original type * Use `multipart_suggestion` rather than multiple suggestions * Check if the name given in the source code matches the name of the actual type
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I left some minor comments.
@bors r+ Thanks! |
📌 Commit 048297b has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
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
Move shell script conversion to a separate file, `convert.rs`. They were previously in `main.rs`. Additionally, implement unsetting environment variables as described in #31. Note: until rust-lang/rust-clippy#8271 is added to Rust in 1.61, `#![allow(clippy::ptr_arg)]` has been added to the top of the file.
fixes #214
fixes #1981
fixes #3381
fixes #6406
fixes #6964
This does not take into account the return type of the function currently, so
(&Vec<_>) -> &Vec<_>
functions may still be false positives.The name given for the type also has to match the real type name, so
type Foo = Vec<u32>
won't trigger the lint, buttype Vec = Vec<u32>
will. I'm not sure if this is the best way to handle this, or if a note about the actual type should be added instead.changelog: Check if the argument is used in a way which requires the original type in
ptr_arg
changelog: Lint mutable references in
ptr_arg