Add safety comments#43
Conversation
|
I believe the original PR covers this. |
|
@MabezDev How so? This PR is adding comprehensive safety documentation. The other PR adds no documentation at all. This repository has gotten unsafe code wrong not once, but twice, in the same bit of code. It currently has no safety comments, just comments explaining why unsafe was used. I did a safety review and found the latest bug. Having safety comments helps people have confidence in your unsafe code, and helps future reviewers quickly audit the code. It is harder to recommend the use of unsafe-using crates that don't have safety comments, especially when they have a track record of safety bugs that misunderstand basic things about UB in Rust. The MaybeUninit discrepancy is a common mistake to make; and whenever I see it usually it means that the code author thinks UB in Rust works like C++, and I've often found it paired with other instances of UB. |
|
I misunderstood this comment: #42 (review). Sorry about that, I'm just trying to keep things moving here with this crate. |
newAM
left a comment
There was a problem hiding this comment.
Looks good to me, thanks for adding these!
Sorry I didn't update my PR, didn't have the time.
Based on #42
This contains #42 but also adds safety comments everywhere.
cc @newAM