@@ -465,8 +465,9 @@ impl<T: ?Sized> *const T {
465465 /// If any of the following conditions are violated, the result is Undefined
466466 /// Behavior:
467467 ///
468- /// * Both the starting and resulting pointer must be either in bounds or one
469- /// byte past the end of the same [allocated object].
468+ /// * If the computed offset is non-zero, then both the starting and resulting pointer must be
469+ /// either in bounds or one byte past the end of the same [allocated object].
470+ /// (If it is zero, then the function is always well-defined.)
470471 ///
471472 /// * The computed offset, **in bytes**, cannot overflow an `isize`.
472473 ///
@@ -676,11 +677,11 @@ impl<T: ?Sized> *const T {
676677 /// If any of the following conditions are violated, the result is Undefined
677678 /// Behavior:
678679 ///
679- /// * Both `self` and `origin` must be either in bounds or one
680- /// byte past the end of the same [allocated object].
680+ /// * `self` and `origin` must either
681681 ///
682- /// * Both pointers must be *derived from* a pointer to the same object.
683- /// (See below for an example.)
682+ /// * both be *derived from* a pointer to the same [allocated object], and the memory range between
683+ /// the two pointers must be either empty or in bounds of that object. (See below for an example.)
684+ /// * or both be derived from an integer literal/constant, and point to the same address.
684685 ///
685686 /// * The distance between the pointers, in bytes, must be an exact multiple
686687 /// of the size of `T`.
@@ -951,8 +952,9 @@ impl<T: ?Sized> *const T {
951952 /// If any of the following conditions are violated, the result is Undefined
952953 /// Behavior:
953954 ///
954- /// * Both the starting and resulting pointer must be either in bounds or one
955- /// byte past the end of the same [allocated object].
955+ /// * If the computed offset is non-zero, then both the starting and resulting pointer must be
956+ /// either in bounds or one byte past the end of the same [allocated object].
957+ /// (If it is zero, then the function is always well-defined.)
956958 ///
957959 /// * The computed offset, **in bytes**, cannot overflow an `isize`.
958960 ///
@@ -1035,8 +1037,9 @@ impl<T: ?Sized> *const T {
10351037 /// If any of the following conditions are violated, the result is Undefined
10361038 /// Behavior:
10371039 ///
1038- /// * Both the starting and resulting pointer must be either in bounds or one
1039- /// byte past the end of the same [allocated object].
1040+ /// * If the computed offset is non-zero, then both the starting and resulting pointer must be
1041+ /// either in bounds or one byte past the end of the same [allocated object].
1042+ /// (If it is zero, then the function is always well-defined.)
10401043 ///
10411044 /// * The computed offset cannot exceed `isize::MAX` **bytes**.
10421045 ///
0 commit comments