Skip to content

Fix clippy notes about safety#1108

Open
lionel- wants to merge 3 commits intomainfrom
task/clippy-unsafe
Open

Fix clippy notes about safety#1108
lionel- wants to merge 3 commits intomainfrom
task/clippy-unsafe

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Mar 11, 2026

  • Commits 1 and 3: Remove unsafe from more harp functions. That fixes the "missing safety doc" lint.

  • Commit 2 (best reviewed separately): Wrap SEXP in a type instead of a type alias, to avoid clippy requiring #[allow(clippy::not_unsafe_ptr_arg_deref)] on every function taking and dereferencing a SEXP. The type is tagged with #[repr(transparent)] to ensure FFI compatibility.

    Wrapping a raw pointer in this way with transparent representation is the standard approach for type safety, see e.g. Pin and NonNull. https://doc.rust-lang.org/reference/type-layout.html#the-transparent-representation

@lionel- lionel- force-pushed the task/clippy-unsafe branch 2 times, most recently from 6bcf156 to f075190 Compare March 11, 2026 17:15
@lionel- lionel- requested a review from DavisVaughan March 11, 2026 17:18
@lionel- lionel- force-pushed the task/clippy-unsafe branch from f075190 to a6714bc Compare March 12, 2026 10:04
@lionel- lionel- mentioned this pull request Mar 12, 2026
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.

1 participant