diff options
| author | Brent Kerby <blkerby@gmail.com> | 2021-05-02 15:55:22 -0600 |
|---|---|---|
| committer | Brent Kerby <blkerby@gmail.com> | 2021-05-02 17:46:00 -0600 |
| commit | 6679f5ceb1bd367050bb69b239d94d6213696336 (patch) | |
| tree | 80d535ea84fcb2c8577be39a3d227d8799e53665 /library/std/src | |
| parent | e10cbc33c1fd2fcd446cab5cdcc57332d154721c (diff) | |
| download | rust-6679f5ceb1bd367050bb69b239d94d6213696336.tar.gz rust-6679f5ceb1bd367050bb69b239d94d6213696336.zip | |
Change 'NULL' to 'null'
Diffstat (limited to 'library/std/src')
| -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 |
5 files changed, 7 insertions, 7 deletions
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`. |
