Skip to content
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

fix: clippy::not_unsafe_ptr_arg_deref #1187

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Nugine
Copy link

@Nugine Nugine commented Dec 8, 2024

@fw-immunant
Copy link
Contributor

Surface rust never calls this function, so it's not really meaningful to mark it unsafe.

@kkysen kkysen reopened this Jan 28, 2025
Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

It doesn't matter if this is called normally or not. It's unsound to mark this as safe. Seems like it passes all of the tests marked unsafe, so that seems fine.

analysis/runtime/src/handlers.rs Show resolved Hide resolved
@fw-immunant
Copy link
Contributor

My point is that there is no calling unsafe block that would place the other half (caller-side) of the SAFETY comment here, as calls to this function are inserted by safe code that modifies MIR regardless of this function's unsafety. If our MIR transformations are incorrect, the object program may exhibit UB; we're operating past Rust's safety boundary here.

@Nugine
Copy link
Author

Nugine commented Jan 31, 2025

This PR is just a style fix for clippy::not_unsafe_ptr_arg_deref. I see this error when using the latest nightly toolchain.
Feel free to accept or close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants