Skip to content

internal: add safety comments in conversions (smallvec, path, vec) - #6259

Merged
alex merged 3 commits into
PyO3:mainfrom
xavierforge:docs/safety-comments-conversions
Jul 29, 2026
Merged

internal: add safety comments in conversions (smallvec, path, vec)#6259
alex merged 3 commits into
PyO3:mainfrom
xavierforge:docs/safety-comments-conversions

Conversation

@xavierforge

@xavierforge xavierforge commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Part of #5487, continuing from #6256.

Removes the #![allow(clippy::undocumented_unsafe_blocks)] exemption from three conversion files, each containing a single unsafe block, and adds // SAFETY: comments:

  • src/conversions/smallvec.rs
  • src/conversions/std/path.rs
  • src/conversions/std/vec.rs

One commit per file for easier review. Happy to split into separate PRs if preferred.

Disclosure: I used AI assistance while analyzing this code; I have personally verified each safety argument against the documented contract of the API being called.

@alex
alex enabled auto-merge July 29, 2026 01:32
@alex alex added the CI-skip-changelog Skip checking changelog entry label Jul 29, 2026
@alex

alex commented Jul 29, 2026

Copy link
Copy Markdown
Member

thanks!

@alex
alex added this pull request to the merge queue Jul 29, 2026
Merged via the queue into PyO3:main with commit bcee20f Jul 29, 2026
53 checks passed
@xavierforge
xavierforge deleted the docs/safety-comments-conversions branch July 30, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-skip-changelog Skip checking changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants