google / google/zerocopy

Minor documentation soundness hole in `Validity`?

Open
#2,965 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.6k
Forks
179
Avg merge
1d 19h
Merged PRs (30d)
29

Description

`Validity` requires:

> Any `V: Validity` must guarantee that this set is only a function of the bit validity of the referent type, `T`, and not of any other property of `T`.

...but `Valid`'s guarantees concern both bit validity *and* safety. By this documentation, a `Ptr::from_ref(&&42)` is unsound, since the validity of the referent `&42` depends its provenance, which isn't a property of bit validity.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.