-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Don't emit needless_pass_by_ref_mut
if the variable is used in an unsafe block or function
#11624
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
Don't emit needless_pass_by_ref_mut
if the variable is used in an unsafe block or function
#11624
Conversation
r? @Jarcho (rustbot has picked a reviewer for you, use r? to override) |
r? @Centri3 |
15d012c
to
a9c63ed
Compare
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.
Ignoring all unsafe
functions is the right move. LGTM, just one nit
a9c63ed
to
33c6e06
Compare
Updated! |
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.
On a closer look these tests don't seem correct (&
instead of &mut
). Also I have a suggestion for the tests
33c6e06
to
6e6e267
Compare
Updated the test and fixed the code (the unsafe check was done on the wrong |
Seems like Centri3 is busy so I was recommended another reviewer. r? @blyxyas |
☔ The latest upstream changes (presumably #11622) made this pull request unmergeable. Please resolve the merge conflicts. |
…nsafe block or function
…t emitted if variable is used in an unsafe block or function
6e6e267
to
80a092c
Compare
Fixed conflict. |
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.
LGTM, thanks! ❤️
@bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #11586.
Fixes #11180.
As suggested in the two issues above, this lint should not be emitted if this an unsafe function or if the argument is used in an unsafe block.
changelog: [
needless_pass_by_ref_mut
]: Don't emit if the variable is used in an unsafe block or function