clarify pointer add/sub function safety concerns
Ralf Jung made the same changes to the offset functions' documentation
in commit fb089156
. As add/sub just call offset, the same limitation
applies here, as well.
Removed emphasis on review request by @joshtriplett
This commit is contained in:
parent
2bab4bf486
commit
e8ec4987a8
1 changed files with 4 additions and 4 deletions
|
@ -1255,7 +1255,7 @@ impl<T: ?Sized> *const T {
|
||||||
/// Behavior:
|
/// Behavior:
|
||||||
///
|
///
|
||||||
/// * Both the starting and resulting pointer must be either in bounds or one
|
/// * Both the starting and resulting pointer must be either in bounds or one
|
||||||
/// byte past the end of an allocated object.
|
/// byte past the end of the same allocated object.
|
||||||
///
|
///
|
||||||
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
||||||
///
|
///
|
||||||
|
@ -1312,7 +1312,7 @@ impl<T: ?Sized> *const T {
|
||||||
/// Behavior:
|
/// Behavior:
|
||||||
///
|
///
|
||||||
/// * Both the starting and resulting pointer must be either in bounds or one
|
/// * Both the starting and resulting pointer must be either in bounds or one
|
||||||
/// byte past the end of an allocated object.
|
/// byte past the end of the same allocated object.
|
||||||
///
|
///
|
||||||
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
|
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
|
||||||
///
|
///
|
||||||
|
@ -1893,7 +1893,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// Behavior:
|
/// Behavior:
|
||||||
///
|
///
|
||||||
/// * Both the starting and resulting pointer must be either in bounds or one
|
/// * Both the starting and resulting pointer must be either in bounds or one
|
||||||
/// byte past the end of an allocated object.
|
/// byte past the end of the same allocated object.
|
||||||
///
|
///
|
||||||
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
||||||
///
|
///
|
||||||
|
@ -1950,7 +1950,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// Behavior:
|
/// Behavior:
|
||||||
///
|
///
|
||||||
/// * Both the starting and resulting pointer must be either in bounds or one
|
/// * Both the starting and resulting pointer must be either in bounds or one
|
||||||
/// byte past the end of an allocated object.
|
/// byte past the end of the same allocated object.
|
||||||
///
|
///
|
||||||
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
|
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue