Stream: t-lang/wg-unsafe-code-guidelines

Topic: read/write_unaligned with ZST


kennytm (Dec 28 2018 at 11:35, on Zulip):

In <https://doc.rust-lang.org/nightly/std/ptr/fn.read_unaligned.html> and <https://doc.rust-lang.org/nightly/std/ptr/fn.write_unaligned.html>, the Safety section mentioned that

Note that even if T has size 0, the pointer must be non-NULL and properly aligned.

Is this just a copy-paste error, or a special restriction for ZSTs?

Nicole Mazzuca (Dec 28 2018 at 11:36, on Zulip):

copy paste error

kennytm (Dec 28 2018 at 11:37, on Zulip):

thanks :)

Last update: Nov 20 2019 at 12:05UTC