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

Document internal unsafety #173

Closed
workingjubilee opened this issue Oct 3, 2021 · 2 comments · Fixed by #280
Closed

Document internal unsafety #173

workingjubilee opened this issue Oct 3, 2021 · 2 comments · Fixed by #280
Assignees
Labels
A-docs Area: documentation for any part of the project. C-bug Category: Bug E-needs-docs Needs documentation added.

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Oct 3, 2021

Currently, we document public unsafe fn and their invariants.

However, as a highly unsafe crate, we should also document internally that we are maintaining invariants for unsafe blocks internally. That said, we are also so unsafe because almost everything is a thin wainscotting over extern "platform-intrinsic" calls. Those are not the focus of this issue. Rather, what we really want to document is anything that isn't just a straight pass-through to an internal unsafe fn intrinsic. These comments need not be publically exposed.

A few of these were surfaced in https://github.com/rust-lang/portable-simd/pull/172/files. Mostly, it's things like our internal implementation of existing trait-level unsafe fn. Also we should probably document the safety invariants on the impl too, not just on the trait.

@workingjubilee workingjubilee added C-bug Category: Bug E-needs-docs Needs documentation added. A-docs Area: documentation for any part of the project. labels Oct 3, 2021
@calebzulawski calebzulawski self-assigned this Nov 5, 2021
@calebzulawski
Copy link
Member

I started implementing this, but found an ICE in clippy: rust-lang/rust-clippy#7934

@calebzulawski
Copy link
Member

I think this is basically complete in the feature/unsafety branch, but I'll wait for a fix to the clippy lint so we can keep it up to date with CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project. C-bug Category: Bug E-needs-docs Needs documentation added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants