Skip to content

Conversation

@TheBestTvarynka
Copy link
Collaborator

Checks for the result of a &self-taking as_ptr being cast to a mutable pointer.

https://rust-lang.github.io/rust-clippy/stable/index.html#as_ptr_cast_mut

Checks for casts of a function pointer to any integer type.

https://rust-lang.github.io/rust-clippy/stable/index.html#fn_to_numeric_cast_any

Checks for as casts between raw pointers that change their constness, namely *const T to *mut T and *mut T to *const T.

https://rust-lang.github.io/rust-clippy/stable/index.html#ptr_cast_constness

Checks for // SAFETY: comments on safe code.

https://rust-lang.github.io/rust-clippy/stable/index.html#unnecessary_safety_comment

Checks for the doc comments of publicly visible unsafe functions and warns if there is no # Safety section.

https://rust-lang.github.io/rust-clippy/stable/index.html#missing_safety_doc

* `as_ptr_cast_mut`
* `fn_to_numeric_cast_any`
* `ptr_cast_constness`
* `unnecessary_safety_comment`
* `missing_safety_doc`
@TheBestTvarynka TheBestTvarynka changed the title refactor: enable safer unsafe clippy lints: refactor: enable safer unsafe clippy lints Nov 27, 2025
@TheBestTvarynka TheBestTvarynka self-assigned this Nov 27, 2025
@TheBestTvarynka TheBestTvarynka marked this pull request as ready for review November 27, 2025 15:15
Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

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

LGTM

@CBenoit CBenoit merged commit dc572ef into master Nov 27, 2025
63 checks passed
@CBenoit CBenoit deleted the refactor/lint-clippy-safer-unsafe branch November 27, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants