diff options
Diffstat (limited to 'library')
| -rw-r--r-- | library/alloc/src/boxed.rs | 2 | ||||
| -rw-r--r-- | library/core/src/intrinsics.rs | 6 | ||||
| -rw-r--r-- | library/core/src/mem/maybe_uninit.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ptr/const_ptr.rs | 6 | ||||
| -rw-r--r-- | library/core/src/ptr/mod.rs | 24 | ||||
| -rw-r--r-- | library/core/src/ptr/mut_ptr.rs | 12 | ||||
| -rw-r--r-- | library/core/src/ptr/non_null.rs | 2 | ||||
| -rw-r--r-- | library/panic_unwind/src/seh.rs | 2 | ||||
| -rw-r--r-- | library/std/src/ffi/c_str.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unix/ext/net/ancillary.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/unix/fs.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/unix/process/process_common.rs | 2 | ||||
| -rw-r--r-- | library/std/src/thread/local.rs | 2 |
13 files changed, 35 insertions, 35 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index ef37fef0455..30a69bfe982 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -84,7 +84,7 @@ //! /* Returns ownership to the caller */ //! struct Foo* foo_new(void); //! -//! /* Takes ownership from the caller; no-op when invoked with NULL */ +//! /* Takes ownership from the caller; no-op when invoked with null */ //! void foo_delete(struct Foo*); //! ``` //! diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 1ba0b23ae5b..d7dd7ee02c1 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1773,7 +1773,7 @@ extern "rust-intrinsic" { /// [violate memory safety][read-ownership]. /// /// Note that even if the effectively copied size (`count * size_of::<T>()`) is - /// `0`, the pointers must be non-NULL and properly aligned. + /// `0`, the pointers must be non-null and properly aligned. /// /// [`read`]: crate::ptr::read /// [read-ownership]: crate::ptr::read#ownership-of-the-returned-value @@ -1857,7 +1857,7 @@ extern "rust-intrinsic" { /// [violate memory safety][read-ownership]. /// /// Note that even if the effectively copied size (`count * size_of::<T>()`) is - /// `0`, the pointers must be non-NULL and properly aligned. + /// `0`, the pointers must be non-null and properly aligned. /// /// [`read`]: crate::ptr::read /// [read-ownership]: crate::ptr::read#ownership-of-the-returned-value @@ -1928,7 +1928,7 @@ pub(crate) fn is_aligned_and_not_null<T>(ptr: *const T) -> bool { /// invalid value of `T` is undefined behavior. /// /// Note that even if the effectively copied size (`count * size_of::<T>()`) is -/// `0`, the pointer must be non-NULL and properly aligned. +/// `0`, the pointer must be non-null and properly aligned. /// /// [valid]: crate::ptr#safety /// diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 4d7d47579ee..f77acdd6180 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -10,7 +10,7 @@ use crate::ptr; /// /// The compiler, in general, assumes that a variable is properly initialized /// according to the requirements of the variable's type. For example, a variable of -/// reference type must be aligned and non-NULL. This is an invariant that must +/// reference type must be aligned and non-null. This is an invariant that must /// *always* be upheld, even in unsafe code. As a consequence, zero-initializing a /// variable of reference type causes instantaneous [undefined behavior][ub], /// no matter whether that reference ever gets used to access memory: diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index b9b2ba9ae61..8348afb2a56 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -66,7 +66,7 @@ impl<T: ?Sized> *const T { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be properly aligned. @@ -130,7 +130,7 @@ impl<T: ?Sized> *const T { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be properly aligned. @@ -974,7 +974,7 @@ impl<T> *const [T] { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be [valid] for reads for `ptr.len() * mem::size_of::<T>()` many bytes, diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index ad8696ab927..415bdde11eb 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -149,7 +149,7 @@ mod mut_ptr; /// again. [`write()`] can be used to overwrite data without causing it to be /// dropped. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. /// /// [valid]: self#safety /// @@ -315,7 +315,7 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] { /// /// * Both `x` and `y` must be properly aligned. /// -/// Note that even if `T` has size `0`, the pointers must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointers must be non-null and properly aligned. /// /// [valid]: self#safety /// @@ -394,7 +394,7 @@ pub const unsafe fn swap<T>(x: *mut T, y: *mut T) { /// beginning at `y` with the same size. /// /// Note that even if the effectively copied size (`count * size_of::<T>()`) is `0`, -/// the pointers must be non-NULL and properly aligned. +/// the pointers must be non-null and properly aligned. /// /// [valid]: self#safety /// @@ -540,7 +540,7 @@ const unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) { /// /// * `dst` must point to a properly initialized value of type `T`. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. /// /// [valid]: self#safety /// @@ -588,7 +588,7 @@ pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T { /// /// * `src` must point to a properly initialized value of type `T`. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. /// /// # Examples /// @@ -713,7 +713,7 @@ pub const unsafe fn read<T>(src: *const T) -> T { /// whether `T` is [`Copy`]. If `T` is not [`Copy`], using both the returned /// value and the value at `*src` can [violate memory safety][read-ownership]. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL. +/// Note that even if `T` has size `0`, the pointer must be non-null. /// /// [read-ownership]: read#ownership-of-the-returned-value /// [valid]: self#safety @@ -818,7 +818,7 @@ pub const unsafe fn read_unaligned<T>(src: *const T) -> T { /// * `dst` must be properly aligned. Use [`write_unaligned`] if this is not the /// case. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. /// /// [valid]: self#safety /// @@ -910,7 +910,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) { /// /// * `dst` must be [valid] for writes. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL. +/// Note that even if `T` has size `0`, the pointer must be non-null. /// /// [valid]: self#safety /// @@ -1024,7 +1024,7 @@ pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) { /// However, storing non-[`Copy`] types in volatile memory is almost certainly /// incorrect. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. /// /// [valid]: self#safety /// [read-ownership]: read#ownership-of-the-returned-value @@ -1094,7 +1094,7 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T { /// /// * `dst` must be properly aligned. /// -/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned. +/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. /// /// [valid]: self#safety /// @@ -1496,7 +1496,7 @@ fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J, K, L } /// /// Note, however, that the `expr` in `addr_of!(expr)` is still subject to all /// the usual rules. In particular, `addr_of!(*ptr::null())` is Undefined -/// Behavior because it dereferences a NULL pointer. +/// Behavior because it dereferences a null pointer. /// /// # Example /// @@ -1536,7 +1536,7 @@ pub macro addr_of($place:expr) { /// /// Note, however, that the `expr` in `addr_of_mut!(expr)` is still subject to all /// the usual rules. In particular, `addr_of_mut!(*ptr::null_mut())` is Undefined -/// Behavior because it dereferences a NULL pointer. +/// Behavior because it dereferences a null pointer. /// /// # Examples /// diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 55c019c51d5..292ac3e3f7f 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -68,7 +68,7 @@ impl<T: ?Sized> *mut T { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be properly aligned. @@ -135,7 +135,7 @@ impl<T: ?Sized> *mut T { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be properly aligned. @@ -314,7 +314,7 @@ impl<T: ?Sized> *mut T { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be properly aligned. @@ -380,7 +380,7 @@ impl<T: ?Sized> *mut T { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be properly aligned. @@ -1237,7 +1237,7 @@ impl<T> *mut [T] { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be [valid] for reads for `ptr.len() * mem::size_of::<T>()` many bytes, @@ -1288,7 +1288,7 @@ impl<T> *mut [T] { /// /// # Safety /// - /// When calling this method, you have to ensure that *either* the pointer is NULL *or* + /// When calling this method, you have to ensure that *either* the pointer is null *or* /// all of the following is true: /// /// * The pointer must be [valid] for reads and writes for `ptr.len() * mem::size_of::<T>()` diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs index e525f616043..1c65518af04 100644 --- a/library/core/src/ptr/non_null.rs +++ b/library/core/src/ptr/non_null.rs @@ -519,7 +519,7 @@ impl<T> NonNull<[T]> { I: SliceIndex<[T]>, { // SAFETY: the caller ensures that `self` is dereferencable and `index` in-bounds. - // As a consequence, the resulting pointer cannot be NULL. + // As a consequence, the resulting pointer cannot be null. unsafe { NonNull::new_unchecked(self.as_ptr().get_unchecked_mut(index)) } } } diff --git a/library/panic_unwind/src/seh.rs b/library/panic_unwind/src/seh.rs index 5597bbb93d2..58028d40576 100644 --- a/library/panic_unwind/src/seh.rs +++ b/library/panic_unwind/src/seh.rs @@ -316,7 +316,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 { } pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> { - // A NULL payload here means that we got here from the catch (...) of + // A null payload here means that we got here from the catch (...) of // __rust_try. This happens when a non-Rust foreign exception is caught. if payload.is_null() { super::__rust_foreign_exception(); diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs index ed4950c57a6..2f9845d7536 100644 --- a/library/std/src/ffi/c_str.rs +++ b/library/std/src/ffi/c_str.rs @@ -498,7 +498,7 @@ impl CString { /// Failure to call [`CString::from_raw`] will lead to a memory leak. /// /// The C side must **not** modify the length of the string (by writing a - /// `NULL` somewhere inside the string or removing the final one) before + /// `null` somewhere inside the string or removing the final one) before /// it makes it back into Rust using [`CString::from_raw`]. See the safety section /// in [`CString::from_raw`]. /// diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs index 011ae643f87..15ce7056fea 100644 --- a/library/std/src/sys/unix/ext/net/ancillary.rs +++ b/library/std/src/sys/unix/ext/net/ancillary.rs @@ -49,7 +49,7 @@ pub(super) fn recv_vectored_with_ancillary_from( msg.msg_controllen = ancillary.buffer.len() as libc::socklen_t; } } - // macos requires that the control pointer is NULL when the len is 0. + // macos requires that the control pointer is null when the len is 0. if msg.msg_controllen > 0 { msg.msg_control = ancillary.buffer.as_mut_ptr().cast(); } @@ -97,7 +97,7 @@ pub(super) fn send_vectored_with_ancillary_to( msg.msg_controllen = ancillary.length as libc::socklen_t; } } - // macos requires that the control pointer is NULL when the len is 0. + // macos requires that the control pointer is null when the len is 0. if msg.msg_controllen > 0 { msg.msg_control = ancillary.buffer.as_mut_ptr().cast(); } diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 45bae25a0c3..79617aa77b7 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -116,7 +116,7 @@ cfg_has_statx! {{ match STATX_STATE.load(Ordering::Relaxed) { 0 => { - // It is a trick to call `statx` with NULL pointers to check if the syscall + // It is a trick to call `statx` with null pointers to check if the syscall // is available. According to the manual, it is expected to fail with EFAULT. // We do this mainly for performance, since it is nearly hundreds times // faster than a normal successful call. @@ -450,7 +450,7 @@ impl Iterator for ReadDir { super::os::set_errno(0); let entry_ptr = libc::readdir(self.inner.dirp.0); if entry_ptr.is_null() { - // NULL can mean either the end is reached or an error occurred. + // null can mean either the end is reached or an error occurred. // So we had to clear errno beforehand to check for an error now. return match super::os::errno() { 0 => None, diff --git a/library/std/src/sys/unix/process/process_common.rs b/library/std/src/sys/unix/process/process_common.rs index b9dcc4e4b9e..c5bdd1bda4a 100644 --- a/library/std/src/sys/unix/process/process_common.rs +++ b/library/std/src/sys/unix/process/process_common.rs @@ -153,7 +153,7 @@ impl Command { } pub fn arg(&mut self, arg: &OsStr) { - // Overwrite the trailing NULL pointer in `argv` and then add a new null + // Overwrite the trailing null pointer in `argv` and then add a new null // pointer. let arg = os2c(arg, &mut self.saw_nul); self.argv.0[self.args.len()] = arg.as_ptr(); diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index abd5b778483..1f5f26e3e14 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -722,7 +722,7 @@ pub mod os { unsafe extern "C" fn destroy_value<T: 'static>(ptr: *mut u8) { // SAFETY: // - // The OS TLS ensures that this key contains a NULL value when this + // The OS TLS ensures that this key contains a null value when this // destructor starts to run. We set it back to a sentinel value of 1 to // ensure that any future calls to `get` for this thread will return // `None`. |
