You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clarify requirements of byte_{offset,add,sub} for zero-sized referents
The safety documentation on `core::ptr` presents this rule:
> For operations of size zero, every pointer is valid, including the null pointer.
However, due to the implementation details of `byte_{offset,add,sub}`,
which involve operations on non-zero-sized referents, this rule does
not apply to these methods.
This commit clarifies extends the over-arching rule with an "unless
otherwise noted" caveat, and clarifies the documentation of
`byte_{offset,add,sub}` to note that the only valid `count` for
zero-sized referents is presently `0`.
0 commit comments