1
Fork 0

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:
Jan Niehusmann 2018-10-14 08:06:36 +00:00
parent 2bab4bf486
commit e8ec4987a8

View file

@ -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**.
/// ///