-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add manual_dangling_ptr
lint
#14107
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 manual_dangling_ptr
lint
#14107
Conversation
8c0a1b3
to
69fe9bb
Compare
ptr::dangling* has been stabilized in Rust 1.84 (https://doc.rust-lang.org/stable/std/ptr/fn.dangling.html), so I think this lint needs to check MSRV. |
69fe9bb
to
604b1c8
Compare
33867dd
to
d0653d4
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.
Looks to be almost there. Just a last set of smaller changes.
This comment has been minimized.
This comment has been minimized.
hi @Jarcho, if the changes look good, I will rebase and squash the commits. |
8f150c8
to
c261d91
Compare
c261d91
to
732e329
Compare
Please update your PR description to include the new name of this lint. |
8b457a3
to
88e4bf3
Compare
manual_dangling_ptr
manual_dangling_ptr
lint
I meant the changelog entry in the description, not the title. |
hi @Jarcho is this ready to be merged? |
3706971
to
b166f89
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.
Looks to be fine. Thank you.
The larger types don't have a consistent alignment on all platforms. I would just avoid using them for tests. |
21207a2
to
4d23351
Compare
#![warn(clippy::manual_dangling_ptr)] | ||
use std::mem; | ||
|
||
pub fn foo(_const: *const f32, _mut: *mut i32) {} |
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.
@Jarcho I have modified the tests to use at most 32-bit types.
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.
could you add the PR to the merge queue?
4d23351
to
7b1f9d8
Compare
close #2177
changelog: [
manual_dangling_ptr
]: new lint