/// The provenance from pointers is *not* combined. The result must only be used to refer to the
/// with [`cast_mut`] on `*const T` and may have documentation value if used instead of implicit
/// provenance][without_provenance_mut], which is undefined behavior to dereference. To properly
/// or [`expose_provenance`][pointer::expose_provenance] and [`with_exposed_provenance`][with_exposed_provenance]
/// [`with_exposed_provenance_mut`] to reconstitute the original pointer including its provenance.
/// Due to its inherent ambiguity, [`with_exposed_provenance_mut`] may not be supported by tools
/// [Strict Provenance][crate::ptr#strict-provenance] APIs such as [`with_addr`][pointer::with_addr]
/// wherever possible, in which case [`addr`][pointer::addr] should be used instead of `expose_provenance`.
/// because all the bytes are dedicated to describing the address. Platforms which need to store
/// If the pointer may be null or the value may be uninitialized, [`as_uninit_ref`] must be used instead.
/// If the pointer may be null, but the value is known to have been initialized, [`as_ref`] must be used instead.
/// When calling this method, you have to ensure that the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion).
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`offset`]
/// `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other
/// If the pointer may be null or the value may be uninitialized, [`as_uninit_mut`] must be used instead.
/// If the pointer may be null, but the value is known to have been initialized, [`as_mut`] must be used instead.
/// spuriously return `None` for pointers that later actually turn out to have its equality known.
/// rely on the result of this function for soundness. It is suggested to only use this function
/// spuriously return `None` for pointers that later actually turn out to have its inequality known.
/// rely on the result of this function for soundness. It is suggested to only use this function
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocation], and the memory range between
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// * The offset in bytes, `count * size_of::<T>()`, computed on mathematical integers (without
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
/// This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
// The actual safety requirements of this function are the same as for `split_at_mut_unchecked`
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
/// * The total size `ptr.len() * size_of::<T>()` of the slice must be no larger than `isize::MAX`.
/// Pointer equality is by address, as produced by the [`<*mut T>::addr`](pointer::addr) method.
/// Pointer comparison is by address, as produced by the [`<*mut T>::addr`](pointer::addr) method.
/// Pointer comparison is by address, as produced by the [`<*mut T>::addr`](pointer::addr) method.