-
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
Add a new lint ptr_as_ptr
#6542
Conversation
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.
LGTM. Only the MSRV stuff is incomplete.
I especially like the suggestion generation and that it doesn't produce unnecessary fishes.
☔ The latest upstream changes (presumably #6538) made this pull request unmergeable. Please resolve the merge conflicts. |
which checks for `as` casts between raw pointers without changing its mutability and suggest replacing it with `pointer::cast`.
It looks like I was not careful enough about the MSRV stuff. Thanks very much for your help! |
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
} | ||
|
||
fn _msrv_1_38() { | ||
#![clippy::msrv = "1.38"] |
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.
Oh I didn't know that inner attributes can also be put into functions. I always assumed that they only work on crate and module level. But it makes sense, that they work for every item(-block)-like thing.
@bors r+ Thanks! |
📌 Commit dfa5d7e has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR adds a new lint
ptr_as_ptr
which checks foras
casts between raw pointers without changing its mutability and suggest replacing it withpointer::cast
. Closes #5890.Open question: should this lint be
pedantic
orstyle
? I set itpedantic
for now because the original post suggests using it, but I think the lint also fits well tostyle
.changelog: New lint
ptr_as_ptr