Audit uses of addr_of!
for read-only-ness
#1607
Labels
blocking-next-release
This issue should be resolved before we release on crates.io
addr_of!
for read-only-ness
#1607
Confirm that our uses of
addr_of!
are sound in light of rust-lang/rust#129653. As of this writing, it appears that there are two uses:One is
Unalign::get_ptr
:zerocopy/src/wrappers.rs
Lines 233 to 235 in b8c3178
One is in
trailing_field_offset!
:zerocopy/src/macro_util.rs
Lines 187 to 189 in b8c3178
The
Unalign::get_ptr
one may be problematic if the user uses the returned*const T
to perform mutation. We may need to clarify in the safety docs on that method that the returned pointer is read-only.The text was updated successfully, but these errors were encountered: