Skip to content

Commit e8ec498

Browse files
committed
clarify pointer add/sub function safety concerns
Ralf Jung made the same changes to the offset functions' documentation in commit fb08915. As add/sub just call offset, the same limitation applies here, as well. Removed emphasis on review request by @joshtriplett
1 parent 2bab4bf commit e8ec498

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ impl<T: ?Sized> *const T {
12551255
/// Behavior:
12561256
///
12571257
/// * Both the starting and resulting pointer must be either in bounds or one
1258-
/// byte past the end of an allocated object.
1258+
/// byte past the end of the same allocated object.
12591259
///
12601260
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
12611261
///
@@ -1312,7 +1312,7 @@ impl<T: ?Sized> *const T {
13121312
/// Behavior:
13131313
///
13141314
/// * Both the starting and resulting pointer must be either in bounds or one
1315-
/// byte past the end of an allocated object.
1315+
/// byte past the end of the same allocated object.
13161316
///
13171317
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
13181318
///
@@ -1893,7 +1893,7 @@ impl<T: ?Sized> *mut T {
18931893
/// Behavior:
18941894
///
18951895
/// * Both the starting and resulting pointer must be either in bounds or one
1896-
/// byte past the end of an allocated object.
1896+
/// byte past the end of the same allocated object.
18971897
///
18981898
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
18991899
///
@@ -1950,7 +1950,7 @@ impl<T: ?Sized> *mut T {
19501950
/// Behavior:
19511951
///
19521952
/// * Both the starting and resulting pointer must be either in bounds or one
1953-
/// byte past the end of an allocated object.
1953+
/// byte past the end of the same allocated object.
19541954
///
19551955
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
19561956
///

0 commit comments

Comments
 (0)