mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
improve comment wording
This commit is contained in:
parent
5c33a5690d
commit
9526ce60fd
@ -434,7 +434,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
|
||||
found_bytes: has.bytes()
|
||||
},
|
||||
);
|
||||
// Make sure this is non-null. (ZST references can be dereferenceable and null.)
|
||||
// Make sure this is non-null. We checked dereferenceability above, but if `size` is zero
|
||||
// that does not imply non-null.
|
||||
if self.ecx.scalar_may_be_null(Scalar::from_maybe_pointer(place.ptr(), self.ecx))? {
|
||||
throw_validation_failure!(self.path, NullPtr { ptr_kind })
|
||||
}
|
||||
|
@ -1484,7 +1484,7 @@ extern "rust-intrinsic" {
|
||||
/// # Safety
|
||||
///
|
||||
/// If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of an allocated object. If either pointer is out
|
||||
/// either in bounds or at the end of an allocated object. If either pointer is out
|
||||
/// of bounds or arithmetic overflow occurs then any further use of the returned value will
|
||||
/// result in undefined behavior.
|
||||
///
|
||||
@ -1502,7 +1502,7 @@ extern "rust-intrinsic" {
|
||||
/// # Safety
|
||||
///
|
||||
/// Unlike the `offset` intrinsic, this intrinsic does not restrict the
|
||||
/// resulting pointer to point into or one byte past the end of an allocated
|
||||
/// resulting pointer to point into or at the end of an allocated
|
||||
/// object, and it wraps with two's complement arithmetic. The resulting
|
||||
/// value is not necessarily valid to be used to actually access memory.
|
||||
///
|
||||
|
@ -465,8 +465,8 @@ impl<T: ?Sized> *const T {
|
||||
/// If any of the following conditions are violated, the result is Undefined
|
||||
/// Behavior:
|
||||
///
|
||||
/// * If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of the same [allocated object].
|
||||
/// * If the computed offset, **in bytes**, is non-zero, then both the starting and resulting
|
||||
/// pointer must be either in bounds or at the end of the same [allocated object].
|
||||
/// (If it is zero, then the function is always well-defined.)
|
||||
///
|
||||
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
||||
@ -952,8 +952,8 @@ impl<T: ?Sized> *const T {
|
||||
/// If any of the following conditions are violated, the result is Undefined
|
||||
/// Behavior:
|
||||
///
|
||||
/// * If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of the same [allocated object].
|
||||
/// * If the computed offset, **in bytes**, is non-zero, then both the starting and resulting
|
||||
/// pointer must be either in bounds or at the end of the same [allocated object].
|
||||
/// (If it is zero, then the function is always well-defined.)
|
||||
///
|
||||
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
||||
@ -1037,8 +1037,8 @@ impl<T: ?Sized> *const T {
|
||||
/// If any of the following conditions are violated, the result is Undefined
|
||||
/// Behavior:
|
||||
///
|
||||
/// * If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of the same [allocated object].
|
||||
/// * If the computed offset, **in bytes**, is non-zero, then both the starting and resulting
|
||||
/// pointer must be either in bounds or at the end of the same [allocated object].
|
||||
/// (If it is zero, then the function is always well-defined.)
|
||||
///
|
||||
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
|
||||
|
@ -480,8 +480,8 @@ impl<T: ?Sized> *mut T {
|
||||
/// If any of the following conditions are violated, the result is Undefined
|
||||
/// Behavior:
|
||||
///
|
||||
/// * If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of the same [allocated object].
|
||||
/// * If the computed offset, **in bytes**, is non-zero, then both the starting and resulting
|
||||
/// pointer must be either in bounds or at the end of the same [allocated object].
|
||||
/// (If it is zero, then the function is always well-defined.)
|
||||
///
|
||||
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
||||
@ -1096,8 +1096,8 @@ impl<T: ?Sized> *mut T {
|
||||
/// If any of the following conditions are violated, the result is Undefined
|
||||
/// Behavior:
|
||||
///
|
||||
/// * If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of the same [allocated object].
|
||||
/// * If the computed offset, **in bytes**, is non-zero, then both the starting and resulting
|
||||
/// pointer must be either in bounds or at the end of the same [allocated object].
|
||||
/// (If it is zero, then the function is always well-defined.)
|
||||
///
|
||||
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
|
||||
@ -1181,8 +1181,8 @@ impl<T: ?Sized> *mut T {
|
||||
/// If any of the following conditions are violated, the result is Undefined
|
||||
/// Behavior:
|
||||
///
|
||||
/// * If the computed offset is non-zero, then both the starting and resulting pointer must be
|
||||
/// either in bounds or one byte past the end of the same [allocated object].
|
||||
/// * If the computed offset, **in bytes**, is non-zero, then both the starting and resulting
|
||||
/// pointer must be either in bounds or at the end of the same [allocated object].
|
||||
/// (If it is zero, then the function is always well-defined.)
|
||||
///
|
||||
/// * The computed offset cannot exceed `isize::MAX` **bytes**.
|
||||
|
Loading…
Reference in New Issue
Block a user