Skip to content

openbsd: Fix some clippy warnings to use pointer::cast. #4490

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

collinfunk
Copy link
Contributor

@collinfunk collinfunk commented Jun 15, 2025

This change just fixes some clippy warnings that are found on OpenBSD like:

warning: `as` casting between raw pointers without changing their constness
   --> src/unix/bsd/netbsdlike/openbsd/mod.rs:633:11
    |
633 |         (*(self as *const siginfo_t as *const siginfo_timer))._pid
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(self as *const siginfo_t).cast::<siginfo_timer>()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
    = note: requested on the command line with `-W clippy::ptr-as-ptr`

@rustbot label +stable-nominated

@rustbot
Copy link
Collaborator

rustbot commented Jun 15, 2025

Some changes occurred in OpenBSD module

cc @semarie

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jun 15, 2025
@collinfunk
Copy link
Contributor Author

Oops, s/net/open. Let me ammend the commit message and force push...

@collinfunk collinfunk force-pushed the netbsd-clippy-cast-warnings branch from 32a3f69 to b94ce9c Compare June 15, 2025 22:51
@collinfunk collinfunk changed the title netbsd: Fix some clippy warnings to use pointer::cast. open: Fix some clippy warnings to use pointer::cast. Jun 15, 2025
@collinfunk collinfunk changed the title open: Fix some clippy warnings to use pointer::cast. openbsd: Fix some clippy warnings to use pointer::cast. Jun 15, 2025
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll need to wait for #4489 before merging this.

@tgross35 tgross35 force-pushed the netbsd-clippy-cast-warnings branch from b94ce9c to 10b7252 Compare June 15, 2025 23:47
@tgross35 tgross35 enabled auto-merge June 15, 2025 23:47
@tgross35 tgross35 added this pull request to the merge queue Jun 16, 2025
Merged via the queue into rust-lang:main with commit db45e3c Jun 16, 2025
50 of 51 checks passed
@collinfunk collinfunk deleted the netbsd-clippy-cast-warnings branch June 16, 2025 01:32
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Jun 17, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Jun 17, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants