From 0b7ccf4cb77e5455f93956aa873c3125f81df57b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 24 Oct 2023 10:17:21 -0700 Subject: [PATCH] Miscellaneous documentation cleanups. (#894) --- README.md | 44 ++++++++++----------- examples/termios.rs | 2 +- src/backend/libc/event/epoll.rs | 10 ++--- src/backend/libc/event/poll_fd.rs | 2 +- src/backend/libc/event/types.rs | 2 +- src/backend/libc/fs/inotify.rs | 4 +- src/backend/libc/fs/types.rs | 28 ++++++------- src/backend/libc/io/types.rs | 6 +-- src/backend/libc/mm/types.rs | 16 ++++---- src/backend/libc/mount/types.rs | 20 +++++----- src/backend/libc/net/read_sockaddr.rs | 19 ++++++++- src/backend/libc/net/send_recv.rs | 4 +- src/backend/libc/net/write_sockaddr.rs | 4 +- src/backend/libc/pipe/types.rs | 4 +- src/backend/libc/rand/types.rs | 2 +- src/backend/libc/shm/types.rs | 2 +- src/backend/libc/time/types.rs | 4 +- src/backend/linux_raw/conv.rs | 4 +- src/backend/linux_raw/event/epoll.rs | 10 ++--- src/backend/linux_raw/event/poll_fd.rs | 2 +- src/backend/linux_raw/event/types.rs | 2 +- src/backend/linux_raw/fs/inotify.rs | 4 +- src/backend/linux_raw/fs/types.rs | 22 +++++------ src/backend/linux_raw/io/types.rs | 6 +-- src/backend/linux_raw/mm/types.rs | 16 ++++---- src/backend/linux_raw/mount/types.rs | 20 +++++----- src/backend/linux_raw/net/read_sockaddr.rs | 6 +-- src/backend/linux_raw/net/send_recv.rs | 4 +- src/backend/linux_raw/net/write_sockaddr.rs | 4 +- src/backend/linux_raw/param/libc_auxv.rs | 4 +- src/backend/linux_raw/pipe/types.rs | 4 +- src/backend/linux_raw/rand/types.rs | 2 +- src/backend/linux_raw/reg.rs | 12 +++--- src/backend/linux_raw/shm/types.rs | 2 +- src/backend/linux_raw/time/types.rs | 4 +- src/backend/linux_raw/vdso_wrappers.rs | 2 +- src/check_types.rs | 4 +- src/event/kqueue.rs | 8 ++-- src/fs/at.rs | 4 +- src/fs/fcntl.rs | 12 +++--- src/fs/xattr.rs | 2 +- src/io/fcntl.rs | 12 +++--- src/io/ioctl.rs | 16 ++------ src/io_uring.rs | 38 +++++++++--------- src/ioctl/mod.rs | 11 ++++-- src/lib.rs | 2 +- src/mm/madvise.rs | 6 +-- src/mm/msync.rs | 6 +-- src/net/send_recv/msg.rs | 6 ++- src/net/sockopt.rs | 4 +- src/path/arg.rs | 2 +- src/path/dec_int.rs | 2 +- src/prctl.rs | 2 +- src/process/kill.rs | 4 +- src/process/membarrier.rs | 2 +- src/process/pidfd.rs | 2 +- src/process/pidfd_getfd.rs | 2 +- src/process/prctl.rs | 18 ++++----- src/process/procctl.rs | 12 +++--- src/process/sched.rs | 4 +- src/process/wait.rs | 40 +++++++++---------- src/pty.rs | 2 +- src/runtime.rs | 4 +- src/static_assertions.rs | 7 ++-- src/termios/types.rs | 8 ++-- src/thread/libcap.rs | 2 +- src/thread/prctl.rs | 20 +++++----- src/thread/setns.rs | 4 +- 68 files changed, 289 insertions(+), 282 deletions(-) diff --git a/README.md b/README.md index dbd79fafb..8ec1a5e14 100644 --- a/README.md +++ b/README.md @@ -55,28 +55,28 @@ building. The modules [`rustix::io`], [`rustix::fd`], and [`rustix::ffi`] are enabled by default. The rest of the API is conditional with cargo feature flags: -| Name | Description -| ---------- | --------------------- -| `event` | [`rustix::event`]—Polling and event operations. -| `fs` | [`rustix::fs`]—Filesystem operations. -| `io_uring` | [`rustix::io_uring`]—Linux io_uring. -| `mm` | [`rustix::mm`]—Memory map operations. -| `mount` | [`rustix::mount`]—Linux mount API. -| `net` | [`rustix::net`]—Network-related operations. -| `param` | [`rustix::param`]—Process parameters. -| `pipe` | [`rustix::pipe`]—Pipe operations. -| `process` | [`rustix::process`]—Process-associated operations. -| `procfs` | [`rustix::procfs`]—Utilities for reading `/proc` on Linux. -| `pty` | [`rustix::pty`]—Pseudoterminal operations. -| `rand` | [`rustix::rand`]—Random-related operations. -| `shm` | [`rustix::shm`]—POSIX shared memory. -| `stdio` | [`rustix::stdio`]—Stdio-related operations. -| `system` | [`rustix::system`]—System-related operations. -| `termios` | [`rustix::termios`]—Terminal I/O stream operations. -| `thread` | [`rustix::thread`]—Thread-associated operations. -| `time` | [`rustix::time`]—Time-related operations. -| | -| `use-libc` | Enable the libc backend. +| Name | Description | +| ---------- | -------------------------------------------------------------- | +| `event` | [`rustix::event`]—Polling and event operations. | +| `fs` | [`rustix::fs`]—Filesystem operations. | +| `io_uring` | [`rustix::io_uring`]—Linux io_uring. | +| `mm` | [`rustix::mm`]—Memory map operations. | +| `mount` | [`rustix::mount`]—Linux mount API. | +| `net` | [`rustix::net`]—Network-related operations. | +| `param` | [`rustix::param`]—Process parameters. | +| `pipe` | [`rustix::pipe`]—Pipe operations. | +| `process` | [`rustix::process`]—Process-associated operations. | +| `procfs` | [`rustix::procfs`]—Utilities for reading `/proc` on Linux. | +| `pty` | [`rustix::pty`]—Pseudoterminal operations. | +| `rand` | [`rustix::rand`]—Random-related operations. | +| `shm` | [`rustix::shm`]—POSIX shared memory. | +| `stdio` | [`rustix::stdio`]—Stdio-related operations. | +| `system` | [`rustix::system`]—System-related operations. | +| `termios` | [`rustix::termios`]—Terminal I/O stream operations. | +| `thread` | [`rustix::thread`]—Thread-associated operations. | +| `time` | [`rustix::time`]—Time-related operations. | +| | | +| `use-libc` | Enable the libc backend. | [`rustix::event`]: https://docs.rs/rustix/*/rustix/event/index.html [`rustix::fs`]: https://docs.rs/rustix/*/rustix/fs/index.html diff --git a/examples/termios.rs b/examples/termios.rs index 7aedc4e84..d82158151 100644 --- a/examples/termios.rs +++ b/examples/termios.rs @@ -28,7 +28,7 @@ fn main() -> std::io::Result<()> { tcsetattr(&tty, OptionalActions::Flush, &raw)?; - print!("Raw settings; press any key..."); + print!("Raw settings; press any key…"); std::io::stdout().flush()?; let mut buf = [0_u8]; let _input = std::io::stdin().read(&mut buf)?; diff --git a/src/backend/libc/event/epoll.rs b/src/backend/libc/event/epoll.rs index 39363bf25..b41b05711 100644 --- a/src/backend/libc/event/epoll.rs +++ b/src/backend/libc/event/epoll.rs @@ -1,8 +1,4 @@ -//! epoll support. -//! -//! This is an experiment, and it isn't yet clear whether epoll is the right -//! level of abstraction at which to introduce safety. But it works fairly well -//! in simple examples 🙂. +//! Linux `epoll` support. //! //! # Examples //! @@ -96,7 +92,7 @@ bitflags! { /// `EPOLL_CLOEXEC` const CLOEXEC = bitcast!(c::EPOLL_CLOEXEC); - /// + /// const _ = !0; } } @@ -152,7 +148,7 @@ bitflags! { #[cfg(not(target_os = "android"))] const EXCLUSIVE = bitcast!(c::EPOLLEXCLUSIVE); - /// + /// const _ = !0; } } diff --git a/src/backend/libc/event/poll_fd.rs b/src/backend/libc/event/poll_fd.rs index 3f795d5aa..42f94f3c7 100644 --- a/src/backend/libc/event/poll_fd.rs +++ b/src/backend/libc/event/poll_fd.rs @@ -48,7 +48,7 @@ bitflags! { )] const RDHUP = c::POLLRDHUP; - /// + /// const _ = !0; } } diff --git a/src/backend/libc/event/types.rs b/src/backend/libc/event/types.rs index af052a434..ea4776667 100644 --- a/src/backend/libc/event/types.rs +++ b/src/backend/libc/event/types.rs @@ -31,7 +31,7 @@ bitflags! { #[cfg(not(target_os = "espidf"))] const SEMAPHORE = bitcast!(c::EFD_SEMAPHORE); - /// + /// const _ = !0; } } diff --git a/src/backend/libc/fs/inotify.rs b/src/backend/libc/fs/inotify.rs index 89a0aef69..2044bd945 100644 --- a/src/backend/libc/fs/inotify.rs +++ b/src/backend/libc/fs/inotify.rs @@ -18,7 +18,7 @@ bitflags! { /// `IN_NONBLOCK` const NONBLOCK = bitcast!(c::IN_NONBLOCK); - /// + /// const _ = !0; } } @@ -75,7 +75,7 @@ bitflags! { /// `IN_ONLYDIR` const ONLYDIR = c::IN_ONLYDIR; - /// + /// const _ = !0; } } diff --git a/src/backend/libc/fs/types.rs b/src/backend/libc/fs/types.rs index 49b8e1573..876757715 100644 --- a/src/backend/libc/fs/types.rs +++ b/src/backend/libc/fs/types.rs @@ -21,7 +21,7 @@ bitflags! { /// `F_OK` const EXISTS = c::F_OK; - /// + /// const _ = !0; } } @@ -77,7 +77,7 @@ bitflags! { #[cfg(all(target_os = "linux", target_env = "gnu"))] const STATX_DONT_SYNC = bitcast!(c::AT_STATX_DONT_SYNC); - /// + /// const _ = !0; } } @@ -151,7 +151,7 @@ bitflags! { #[cfg(not(any(target_os = "espidf", target_os = "vita")))] const SVTX = c::S_ISVTX as RawMode; - /// + /// const _ = !0; } } @@ -328,7 +328,7 @@ bitflags! { #[cfg(target_os = "freebsd")] const EMPTY_PATH = bitcast!(c::O_EMPTY_PATH); - /// + /// const _ = !0; } } @@ -347,7 +347,7 @@ bitflags! { /// `CLONE_NOOWNERCOPY` const NOOWNERCOPY = 2; - /// + /// const _ = !0; } } @@ -392,7 +392,7 @@ bitflags! { /// `COPYFILE_ALL` const ALL = copyfile::ALL; - /// + /// const _ = !0; } } @@ -423,7 +423,7 @@ bitflags! { /// `RESOLVE_CACHED` (since Linux 5.12) const CACHED = 0x20; - /// + /// const _ = !0; } } @@ -445,7 +445,7 @@ bitflags! { /// `RENAME_WHITEOUT` const WHITEOUT = bitcast!(c::RENAME_WHITEOUT); - /// + /// const _ = !0; } } @@ -625,7 +625,7 @@ bitflags! { /// `MFD_HUGE_16GB` const HUGE_16GB = c::MFD_HUGE_16GB; - /// + /// const _ = !0; } } @@ -652,7 +652,7 @@ bitflags! { #[cfg(linux_kernel)] const FUTURE_WRITE = bitcast!(c::F_SEAL_FUTURE_WRITE); - /// + /// const _ = !0; } } @@ -713,7 +713,7 @@ bitflags! { /// `STATX_ALL` const ALL = c::STATX_ALL; - /// + /// const _ = !0; } } @@ -774,7 +774,7 @@ bitflags! { /// `STATX_ALL` const ALL = 0xfff; - /// + /// const _ = !0; } } @@ -867,7 +867,7 @@ bitflags! { )))] const UNSHARE_RANGE = bitcast!(c::FALLOC_FL_UNSHARE_RANGE); - /// + /// const _ = !0; } } @@ -919,7 +919,7 @@ bitflags! { #[cfg(any(linux_kernel, target_os = "emscripten", target_os = "fuchsia"))] const SYNCHRONOUS = c::ST_SYNCHRONOUS as u64; - /// + /// const _ = !0; } } diff --git a/src/backend/libc/io/types.rs b/src/backend/libc/io/types.rs index eaf3eae71..510206f98 100644 --- a/src/backend/libc/io/types.rs +++ b/src/backend/libc/io/types.rs @@ -12,7 +12,7 @@ bitflags! { /// `FD_CLOEXEC` const CLOEXEC = bitcast!(c::FD_CLOEXEC); - /// + /// const _ = !0; } } @@ -37,7 +37,7 @@ bitflags! { /// `RWF_APPEND` (since Linux 4.16) const APPEND = linux_raw_sys::general::RWF_APPEND; - /// + /// const _ = !0; } } @@ -59,7 +59,7 @@ bitflags! { )))] // Android 5.0 has dup3, but libc doesn't have bindings const CLOEXEC = bitcast!(c::O_CLOEXEC); - /// + /// const _ = !0; } } diff --git a/src/backend/libc/mm/types.rs b/src/backend/libc/mm/types.rs index 4554f58ae..ef335d27a 100644 --- a/src/backend/libc/mm/types.rs +++ b/src/backend/libc/mm/types.rs @@ -17,7 +17,7 @@ bitflags! { /// `PROT_EXEC` const EXEC = bitcast!(c::PROT_EXEC); - /// + /// const _ = !0; } } @@ -59,7 +59,7 @@ bitflags! { #[cfg(all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64")))] const ADI = linux_raw_sys::general::PROT_ADI; - /// + /// const _ = !0; } } @@ -231,7 +231,7 @@ bitflags! { #[cfg(any())] const UNINITIALIZED = bitcast!(c::MAP_UNINITIALIZED); - /// + /// const _ = !0; } } @@ -250,7 +250,7 @@ bitflags! { /// `MREMAP_MAYMOVE` const MAYMOVE = bitcast!(c::MREMAP_MAYMOVE); - /// + /// const _ = !0; } } @@ -272,7 +272,7 @@ bitflags! { /// written). const INVALIDATE = bitcast!(c::MS_INVALIDATE); - /// + /// const _ = !0; } } @@ -288,7 +288,7 @@ bitflags! { /// `MLOCK_ONFAULT` const ONFAULT = bitcast!(c::MLOCK_ONFAULT); - /// + /// const _ = !0; } } @@ -438,7 +438,7 @@ bitflags! { /// `O_NONBLOCK` const NONBLOCK = bitcast!(c::O_NONBLOCK); - /// + /// const _ = !0; } } @@ -462,7 +462,7 @@ bitflags! { /// the process. const CURRENT = bitcast!(libc::MCL_CURRENT); - /// + /// const _ = !0; } } diff --git a/src/backend/libc/mount/types.rs b/src/backend/libc/mount/types.rs index fc7ad5153..d4f9c2da7 100644 --- a/src/backend/libc/mount/types.rs +++ b/src/backend/libc/mount/types.rs @@ -55,7 +55,7 @@ bitflags! { /// `MS_SYNCHRONOUS` const SYNCHRONOUS = c::MS_SYNCHRONOUS; - /// + /// const _ = !0; } } @@ -77,7 +77,7 @@ bitflags! { /// `UMOUNT_NOFOLLOW` const NOFOLLOW = bitcast!(c::UMOUNT_NOFOLLOW); - /// + /// const _ = !0; } } @@ -94,7 +94,7 @@ bitflags! { /// `FSOPEN_CLOEXEC` const FSOPEN_CLOEXEC = 0x0000_0001; - /// + /// const _ = !0; } } @@ -111,7 +111,7 @@ bitflags! { /// `FSMOUNT_CLOEXEC` const FSMOUNT_CLOEXEC = 0x0000_0001; - /// + /// const _ = !0; } } @@ -192,7 +192,7 @@ bitflags! { /// `MOUNT_ATTR__ATIME_FLAGS` const MOUNT_ATTR_SIZE_VER0 = 32; - /// + /// const _ = !0; } } @@ -234,7 +234,7 @@ bitflags! { /// `MOVE_MOUNT__MASK` const MOVE_MOUNT__MASK = 0x0000_0377; - /// + /// const _ = !0; } } @@ -266,7 +266,7 @@ bitflags! { /// `AT_SYMLINK_NOFOLLOW` const AT_SYMLINK_NOFOLLOW = c::AT_SYMLINK_NOFOLLOW as c::c_uint; - /// + /// const _ = !0; } } @@ -292,7 +292,7 @@ bitflags! { /// `FSPICK_EMPTY_PATH` const FSPICK_EMPTY_PATH = 0x0000_0008; - /// + /// const _ = !0; } } @@ -318,7 +318,7 @@ bitflags! { /// `MS_REC` const REC = c::MS_REC; - /// + /// const _ = !0; } } @@ -331,7 +331,7 @@ bitflags! { const REMOUNT = c::MS_REMOUNT; const MOVE = c::MS_MOVE; - /// + /// const _ = !0; } } diff --git a/src/backend/libc/net/read_sockaddr.rs b/src/backend/libc/net/read_sockaddr.rs index 3a670d628..0588c41c6 100644 --- a/src/backend/libc/net/read_sockaddr.rs +++ b/src/backend/libc/net/read_sockaddr.rs @@ -1,5 +1,5 @@ -//! The BSD sockets API requires us to read the `ss_family` field before -//! we can interpret the rest of a `sockaddr` produced by the kernel. +//! The BSD sockets API requires us to read the `ss_family` field before we can +//! interpret the rest of a `sockaddr` produced by the kernel. #[cfg(unix)] use super::addr::SocketAddrUnix; @@ -43,6 +43,11 @@ struct sockaddr_header { ss_family: u16, } +/// Read the `ss_family` field from a socket address returned from the OS. +/// +/// # Safety +/// +/// `storage` must point to a valid socket address returned from the OS. #[inline] unsafe fn read_ss_family(storage: *const c::sockaddr_storage) -> u16 { // Assert that we know the layout of `sockaddr`. @@ -192,6 +197,11 @@ pub(crate) unsafe fn read_sockaddr( } } +/// Read an optional socket address returned from the OS. +/// +/// # Safety +/// +/// `storage` must point to a valid socket address returned from the OS. pub(crate) unsafe fn maybe_read_sockaddr_os( storage: *const c::sockaddr_storage, len: usize, @@ -209,6 +219,11 @@ pub(crate) unsafe fn maybe_read_sockaddr_os( } } +/// Read a socket address returned from the OS. +/// +/// # Safety +/// +/// `storage` must point to a valid socket address returned from the OS. pub(crate) unsafe fn read_sockaddr_os( storage: *const c::sockaddr_storage, len: usize, diff --git a/src/backend/libc/net/send_recv.rs b/src/backend/libc/net/send_recv.rs index 86d16edef..5dc60ddcd 100644 --- a/src/backend/libc/net/send_recv.rs +++ b/src/backend/libc/net/send_recv.rs @@ -47,7 +47,7 @@ bitflags! { /// `MSG_OOB` const OOB = bitcast!(c::MSG_OOB); - /// + /// const _ = !0; } } @@ -97,7 +97,7 @@ bitflags! { /// `MSG_WAITALL` const WAITALL = bitcast!(c::MSG_WAITALL); - /// + /// const _ = !0; } } diff --git a/src/backend/libc/net/write_sockaddr.rs b/src/backend/libc/net/write_sockaddr.rs index 1bccf9a0f..2eee98cb8 100644 --- a/src/backend/libc/net/write_sockaddr.rs +++ b/src/backend/libc/net/write_sockaddr.rs @@ -1,5 +1,5 @@ -//! The BSD sockets API requires us to read the `ss_family` field before -//! we can interpret the rest of a `sockaddr` produced by the kernel. +//! The BSD sockets API requires us to read the `ss_family` field before we can +//! interpret the rest of a `sockaddr` produced by the kernel. use super::addr::SocketAddrStorage; #[cfg(unix)] diff --git a/src/backend/libc/pipe/types.rs b/src/backend/libc/pipe/types.rs index 5262e3ee9..1004e41f7 100644 --- a/src/backend/libc/pipe/types.rs +++ b/src/backend/libc/pipe/types.rs @@ -27,7 +27,7 @@ bitflags! { /// `O_NONBLOCK` const NONBLOCK = bitcast!(c::O_NONBLOCK); - /// + /// const _ = !0; } } @@ -48,7 +48,7 @@ bitflags! { /// `SPLICE_F_GIFT` const GIFT = c::SPLICE_F_GIFT; - /// + /// const _ = !0; } } diff --git a/src/backend/libc/rand/types.rs b/src/backend/libc/rand/types.rs index cd436b618..46690b57f 100644 --- a/src/backend/libc/rand/types.rs +++ b/src/backend/libc/rand/types.rs @@ -18,7 +18,7 @@ bitflags! { /// `GRND_INSECURE` const INSECURE = c::GRND_INSECURE; - /// + /// const _ = !0; } } diff --git a/src/backend/libc/shm/types.rs b/src/backend/libc/shm/types.rs index 173d95108..6575ef523 100644 --- a/src/backend/libc/shm/types.rs +++ b/src/backend/libc/shm/types.rs @@ -24,7 +24,7 @@ bitflags! { /// `O_TRUNC` const TRUNC = bitcast!(c::O_TRUNC); - /// + /// const _ = !0; } } diff --git a/src/backend/libc/time/types.rs b/src/backend/libc/time/types.rs index 4d8c6bdab..1514b02d0 100644 --- a/src/backend/libc/time/types.rs +++ b/src/backend/libc/time/types.rs @@ -88,7 +88,7 @@ bitflags! { /// `TFD_CLOEXEC` const CLOEXEC = bitcast!(c::TFD_CLOEXEC); - /// + /// const _ = !0; } } @@ -108,7 +108,7 @@ bitflags! { #[cfg(linux_kernel)] const CANCEL_ON_SET = bitcast!(c::TFD_TIMER_CANCEL_ON_SET); - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/conv.rs b/src/backend/linux_raw/conv.rs index fcaf3469e..4b3c15d7a 100644 --- a/src/backend/linux_raw/conv.rs +++ b/src/backend/linux_raw/conv.rs @@ -2,8 +2,8 @@ //! //! System call arguments and return values are all communicated with inline //! asm and FFI as `*mut Opaque`. To protect these raw pointers from escaping -//! or being accidentally misused as they travel through the code, we wrap -//! them in [`ArgReg`] and [`RetReg`] structs. This file provides `From` +//! or being accidentally misused as they travel through the code, we wrap them +//! in [`ArgReg`] and [`RetReg`] structs. This file provides `From` //! implementations and explicit conversion functions for converting values //! into and out of these wrapper structs. //! diff --git a/src/backend/linux_raw/event/epoll.rs b/src/backend/linux_raw/event/epoll.rs index 90fde2d83..6aa84d7aa 100644 --- a/src/backend/linux_raw/event/epoll.rs +++ b/src/backend/linux_raw/event/epoll.rs @@ -1,8 +1,4 @@ -//! epoll support. -//! -//! This is an experiment, and it isn't yet clear whether epoll is the right -//! level of abstraction at which to introduce safety. But it works fairly well -//! in simple examples 🙂. +//! Linx `epoll` support. //! //! # Examples //! @@ -94,7 +90,7 @@ bitflags! { /// `EPOLL_CLOEXEC` const CLOEXEC = linux_raw_sys::general::EPOLL_CLOEXEC; - /// + /// const _ = !0; } } @@ -149,7 +145,7 @@ bitflags! { /// `EPOLLEXCLUSIVE` const EXCLUSIVE = linux_raw_sys::general::EPOLLEXCLUSIVE as u32; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/event/poll_fd.rs b/src/backend/linux_raw/event/poll_fd.rs index c56c9152d..51c222e62 100644 --- a/src/backend/linux_raw/event/poll_fd.rs +++ b/src/backend/linux_raw/event/poll_fd.rs @@ -31,7 +31,7 @@ bitflags! { /// `POLLRDHUP` const RDHUP = linux_raw_sys::general::POLLRDHUP as u16; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/event/types.rs b/src/backend/linux_raw/event/types.rs index 3821f8f64..eb34bd0b3 100644 --- a/src/backend/linux_raw/event/types.rs +++ b/src/backend/linux_raw/event/types.rs @@ -15,7 +15,7 @@ bitflags! { /// `EFD_SEMAPHORE` const SEMAPHORE = linux_raw_sys::general::EFD_SEMAPHORE; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/fs/inotify.rs b/src/backend/linux_raw/fs/inotify.rs index be32e97de..aaba71d7c 100644 --- a/src/backend/linux_raw/fs/inotify.rs +++ b/src/backend/linux_raw/fs/inotify.rs @@ -18,7 +18,7 @@ bitflags! { /// `IN_NONBLOCK` const NONBLOCK = linux_raw_sys::general::IN_NONBLOCK; - /// + /// const _ = !0; } } @@ -75,7 +75,7 @@ bitflags! { /// `IN_ONLYDIR` const ONLYDIR = linux_raw_sys::general::IN_ONLYDIR; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/fs/types.rs b/src/backend/linux_raw/fs/types.rs index c1a8f213a..85fe018a3 100644 --- a/src/backend/linux_raw/fs/types.rs +++ b/src/backend/linux_raw/fs/types.rs @@ -20,7 +20,7 @@ bitflags! { /// `F_OK` const EXISTS = linux_raw_sys::general::F_OK; - /// + /// const _ = !0; } } @@ -61,7 +61,7 @@ bitflags! { /// `AT_STATX_DONT_SYNC` const STATX_DONT_SYNC = linux_raw_sys::general::AT_STATX_DONT_SYNC; - /// + /// const _ = !0; } } @@ -120,7 +120,7 @@ bitflags! { /// `S_ISVTX` const SVTX = linux_raw_sys::general::S_ISVTX; - /// + /// const _ = !0; } } @@ -250,7 +250,7 @@ bitflags! { /// `O_DIRECT` const DIRECT = linux_raw_sys::general::O_DIRECT; - /// + /// const _ = !0; } } @@ -280,7 +280,7 @@ bitflags! { /// `RESOLVE_CACHED` (since Linux 5.12) const CACHED = linux_raw_sys::general::RESOLVE_CACHED as u64; - /// + /// const _ = !0; } } @@ -301,7 +301,7 @@ bitflags! { /// `RENAME_WHITEOUT` const WHITEOUT = linux_raw_sys::general::RENAME_WHITEOUT; - /// + /// const _ = !0; } } @@ -453,7 +453,7 @@ bitflags! { /// `MFD_HUGE_16GB` const HUGE_16GB = linux_raw_sys::general::MFD_HUGE_16GB; - /// + /// const _ = !0; } } @@ -478,7 +478,7 @@ bitflags! { /// `F_SEAL_FUTURE_WRITE` (since Linux 5.1) const FUTURE_WRITE = linux_raw_sys::general::F_SEAL_FUTURE_WRITE; - /// + /// const _ = !0; } } @@ -538,7 +538,7 @@ bitflags! { /// `STATX_ALL` const ALL = linux_raw_sys::general::STATX_ALL; - /// + /// const _ = !0; } } @@ -565,7 +565,7 @@ bitflags! { /// `FALLOC_FL_UNSHARE_RANGE` const UNSHARE_RANGE = linux_raw_sys::general::FALLOC_FL_UNSHARE_RANGE; - /// + /// const _ = !0; } } @@ -602,7 +602,7 @@ bitflags! { /// `ST_SYNCHRONOUS` const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS as u64; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/io/types.rs b/src/backend/linux_raw/io/types.rs index fb7e913a0..4b3dfc686 100644 --- a/src/backend/linux_raw/io/types.rs +++ b/src/backend/linux_raw/io/types.rs @@ -12,7 +12,7 @@ bitflags! { /// `FD_CLOEXEC` const CLOEXEC = linux_raw_sys::general::FD_CLOEXEC; - /// + /// const _ = !0; } } @@ -36,7 +36,7 @@ bitflags! { /// `RWF_APPEND` (since Linux 4.16) const APPEND = linux_raw_sys::general::RWF_APPEND; - /// + /// const _ = !0; } } @@ -51,7 +51,7 @@ bitflags! { /// `O_CLOEXEC` const CLOEXEC = linux_raw_sys::general::O_CLOEXEC; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/mm/types.rs b/src/backend/linux_raw/mm/types.rs index 0754ba7cb..b5e36640d 100644 --- a/src/backend/linux_raw/mm/types.rs +++ b/src/backend/linux_raw/mm/types.rs @@ -17,7 +17,7 @@ bitflags! { /// `PROT_EXEC` const EXEC = linux_raw_sys::general::PROT_EXEC; - /// + /// const _ = !0; } } @@ -56,7 +56,7 @@ bitflags! { #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] const ADI = linux_raw_sys::general::PROT_ADI; - /// + /// const _ = !0; } } @@ -106,7 +106,7 @@ bitflags! { #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6")))] const UNINITIALIZED = linux_raw_sys::general::MAP_UNINITIALIZED; - /// + /// const _ = !0; } } @@ -126,7 +126,7 @@ bitflags! { /// `MREMAP_DONTUNMAP` (since Linux 5.7) const DONTUNMAP = linux_raw_sys::general::MREMAP_DONTUNMAP; - /// + /// const _ = !0; } } @@ -148,7 +148,7 @@ bitflags! { /// written). const INVALIDATE = linux_raw_sys::general::MS_INVALIDATE; - /// + /// const _ = !0; } } @@ -163,7 +163,7 @@ bitflags! { /// `MLOCK_ONFAULT` const ONFAULT = linux_raw_sys::general::MLOCK_ONFAULT; - /// + /// const _ = !0; } } @@ -258,7 +258,7 @@ bitflags! { /// `O_NONBLOCK` const NONBLOCK = linux_raw_sys::general::O_NONBLOCK; - /// + /// const _ = !0; } } @@ -290,7 +290,7 @@ bitflags! { /// the process. const CURRENT = linux_raw_sys::general::MCL_CURRENT; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/mount/types.rs b/src/backend/linux_raw/mount/types.rs index 221f8f315..3a797ab77 100644 --- a/src/backend/linux_raw/mount/types.rs +++ b/src/backend/linux_raw/mount/types.rs @@ -57,7 +57,7 @@ bitflags! { /// `MS_NOSYMFOLLOW` const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW; - /// + /// const _ = !0; } } @@ -78,7 +78,7 @@ bitflags! { /// `UMOUNT_NOFOLLOW` const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW; - /// + /// const _ = !0; } } @@ -94,7 +94,7 @@ bitflags! { /// `FSOPEN_CLOEXEC` const FSOPEN_CLOEXEC = linux_raw_sys::general::FSOPEN_CLOEXEC; - /// + /// const _ = !0; } } @@ -110,7 +110,7 @@ bitflags! { /// `FSMOUNT_CLOEXEC` const FSMOUNT_CLOEXEC = linux_raw_sys::general::FSMOUNT_CLOEXEC; - /// + /// const _ = !0; } } @@ -189,7 +189,7 @@ bitflags! { /// `MOUNT_ATTR__ATIME_FLAGS` const MOUNT_ATTR_SIZE_VER0 = linux_raw_sys::general::MOUNT_ATTR_SIZE_VER0; - /// + /// const _ = !0; } } @@ -230,7 +230,7 @@ bitflags! { /// `MOVE_MOUNT__MASK` const MOVE_MOUNT__MASK = linux_raw_sys::general::MOVE_MOUNT__MASK; - /// + /// const _ = !0; } } @@ -261,7 +261,7 @@ bitflags! { /// `AT_SYMLINK_NOFOLLOW` const AT_SYMLINK_NOFOLLOW = linux_raw_sys::general::AT_SYMLINK_NOFOLLOW; - /// + /// const _ = !0; } } @@ -286,7 +286,7 @@ bitflags! { /// `FSPICK_EMPTY_PATH` const FSPICK_EMPTY_PATH = linux_raw_sys::general::FSPICK_EMPTY_PATH; - /// + /// const _ = !0; } } @@ -311,7 +311,7 @@ bitflags! { /// `MS_REC` const REC = linux_raw_sys::general::MS_REC; - /// + /// const _ = !0; } } @@ -323,7 +323,7 @@ bitflags! { const REMOUNT = linux_raw_sys::general::MS_REMOUNT; const MOVE = linux_raw_sys::general::MS_MOVE; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/net/read_sockaddr.rs b/src/backend/linux_raw/net/read_sockaddr.rs index f4b7d9914..af7282c98 100644 --- a/src/backend/linux_raw/net/read_sockaddr.rs +++ b/src/backend/linux_raw/net/read_sockaddr.rs @@ -1,5 +1,5 @@ -//! The BSD sockets API requires us to read the `ss_family` field before -//! we can interpret the rest of a `sockaddr` produced by the kernel. +//! The BSD sockets API requires us to read the `ss_family` field before we can +//! interpret the rest of a `sockaddr` produced by the kernel. #![allow(unsafe_code)] use crate::backend::c; @@ -110,7 +110,7 @@ pub(crate) unsafe fn read_sockaddr( } } -/// Read a socket address returned from the OS. +/// Read an optional socket address returned from the OS. /// /// # Safety /// diff --git a/src/backend/linux_raw/net/send_recv.rs b/src/backend/linux_raw/net/send_recv.rs index 69419207d..d5cdd075e 100644 --- a/src/backend/linux_raw/net/send_recv.rs +++ b/src/backend/linux_raw/net/send_recv.rs @@ -25,7 +25,7 @@ bitflags! { /// `MSG_OOB` const OOB = c::MSG_OOB; - /// + /// const _ = !0; } } @@ -54,7 +54,7 @@ bitflags! { /// `MSG_WAITALL` const WAITALL = c::MSG_WAITALL; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/net/write_sockaddr.rs b/src/backend/linux_raw/net/write_sockaddr.rs index 417f76e43..24edd4948 100644 --- a/src/backend/linux_raw/net/write_sockaddr.rs +++ b/src/backend/linux_raw/net/write_sockaddr.rs @@ -1,5 +1,5 @@ -//! The BSD sockets API requires us to read the `ss_family` field before -//! we can interpret the rest of a `sockaddr` produced by the kernel. +//! The BSD sockets API requires us to read the `ss_family` field before we can +//! interpret the rest of a `sockaddr` produced by the kernel. #![allow(unsafe_code)] use crate::backend::c; diff --git a/src/backend/linux_raw/param/libc_auxv.rs b/src/backend/linux_raw/param/libc_auxv.rs index 97e51a2ca..311cf961b 100644 --- a/src/backend/linux_raw/param/libc_auxv.rs +++ b/src/backend/linux_raw/param/libc_auxv.rs @@ -139,8 +139,8 @@ pub(crate) fn exe_phdrs() -> (*const c::c_void, usize, usize) { } } -/// `AT_SYSINFO_EHDR` isn't present on all platforms in all configurations, -/// so if we don't see it, this function returns a null pointer. +/// `AT_SYSINFO_EHDR` isn't present on all platforms in all configurations, so +/// if we don't see it, this function returns a null pointer. #[inline] pub(in super::super) fn sysinfo_ehdr() -> *const Elf_Ehdr { #[cfg(not(feature = "runtime"))] diff --git a/src/backend/linux_raw/pipe/types.rs b/src/backend/linux_raw/pipe/types.rs index c950b5d0a..fdddb89e1 100644 --- a/src/backend/linux_raw/pipe/types.rs +++ b/src/backend/linux_raw/pipe/types.rs @@ -16,7 +16,7 @@ bitflags! { /// `O_NONBLOCK` const NONBLOCK = linux_raw_sys::general::O_NONBLOCK; - /// + /// const _ = !0; } } @@ -36,7 +36,7 @@ bitflags! { /// `SPLICE_F_GIFT` const GIFT = linux_raw_sys::general::SPLICE_F_GIFT; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/rand/types.rs b/src/backend/linux_raw/rand/types.rs index 47b996d30..9bc857fdd 100644 --- a/src/backend/linux_raw/rand/types.rs +++ b/src/backend/linux_raw/rand/types.rs @@ -14,7 +14,7 @@ bitflags! { /// `GRND_INSECURE` const INSECURE = linux_raw_sys::general::GRND_INSECURE; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/reg.rs b/src/backend/linux_raw/reg.rs index c4e495c52..10f95a5f9 100644 --- a/src/backend/linux_raw/reg.rs +++ b/src/backend/linux_raw/reg.rs @@ -1,8 +1,8 @@ //! Encapsulation for system call arguments and return values. //! //! The inline-asm code paths do some amount of reordering of arguments; to -//! ensure that we don't accidentally misroute an argument or return value, -//! we use distinct types for each argument index and return value. +//! ensure that we don't accidentally misroute an argument or return value, we +//! use distinct types for each argument index and return value. //! //! # Safety //! @@ -23,8 +23,8 @@ pub(super) trait ToAsm: private::Sealed { /// /// # Safety /// - /// This should be used immediately before the syscall instruction, and - /// the returned value shouldn't be used for any other purpose. + /// This should be used immediately before the syscall instruction, and the + /// returned value shouldn't be used for any other purpose. #[must_use] unsafe fn to_asm(self) -> *mut Opaque; } @@ -35,8 +35,8 @@ pub(super) trait FromAsm: private::Sealed { /// /// # Safety /// - /// This should be used immediately after the syscall instruction, and - /// the operand value shouldn't be used for any other purpose. + /// This should be used immediately after the syscall instruction, and the + /// operand value shouldn't be used for any other purpose. #[must_use] unsafe fn from_asm(raw: *mut Opaque) -> Self; } diff --git a/src/backend/linux_raw/shm/types.rs b/src/backend/linux_raw/shm/types.rs index 7c35642ec..3343d4424 100644 --- a/src/backend/linux_raw/shm/types.rs +++ b/src/backend/linux_raw/shm/types.rs @@ -24,7 +24,7 @@ bitflags! { /// `O_TRUNC` const TRUNC = linux_raw_sys::general::O_TRUNC; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/time/types.rs b/src/backend/linux_raw/time/types.rs index ab43aed7c..f3e653b0a 100644 --- a/src/backend/linux_raw/time/types.rs +++ b/src/backend/linux_raw/time/types.rs @@ -21,7 +21,7 @@ bitflags! { /// `TFD_CLOEXEC` const CLOEXEC = linux_raw_sys::general::TFD_CLOEXEC; - /// + /// const _ = !0; } } @@ -39,7 +39,7 @@ bitflags! { /// `TFD_TIMER_CANCEL_ON_SET` const CANCEL_ON_SET = linux_raw_sys::general::TFD_TIMER_CANCEL_ON_SET; - /// + /// const _ = !0; } } diff --git a/src/backend/linux_raw/vdso_wrappers.rs b/src/backend/linux_raw/vdso_wrappers.rs index 1bbffaca8..601dc1855 100644 --- a/src/backend/linux_raw/vdso_wrappers.rs +++ b/src/backend/linux_raw/vdso_wrappers.rs @@ -318,7 +318,7 @@ unsafe fn _rustix_clock_gettime_via_syscall( #[cfg(target_arch = "x86")] extern "C" { /// A symbol pointing to an `int 0x80` instruction. This “function” is only - /// called from assembly, and only with the x86 syscall calling convention. + /// called from assembly, and only with the x86 syscall calling convention, /// so its signature here is not its true signature. /// /// This extern block and the `global_asm!` below can be replaced with diff --git a/src/check_types.rs b/src/check_types.rs index 1ded57502..0140b6d73 100644 --- a/src/check_types.rs +++ b/src/check_types.rs @@ -54,8 +54,8 @@ macro_rules! check_struct_renamed_field { }; } -/// The same as `check_struct_renamed_field`, but for when both the struct -/// and a field are renamed. +/// The same as `check_struct_renamed_field`, but for when both the struct and +/// a field are renamed. macro_rules! check_renamed_struct_renamed_field { ($to_struct:ident, $from_struct:ident, $to:ident, $from:ident) => { const_assert_eq!( diff --git a/src/event/kqueue.rs b/src/event/kqueue.rs index 08567d20b..cd996aaea 100644 --- a/src/event/kqueue.rs +++ b/src/event/kqueue.rs @@ -263,7 +263,7 @@ bitflags::bitflags! { /// TODO const ERROR = c::EV_ERROR as _; - /// + /// const _ = !0; } } @@ -294,7 +294,7 @@ bitflags::bitflags! { /// The link count of the file has changed. const LINK = c::NOTE_LINK; - /// + /// const _ = !0; } } @@ -319,7 +319,7 @@ bitflags::bitflags! { /// An error has occurred with following the process. const TRACKERR = c::NOTE_TRACKERR; - /// + /// const _ = !0; } } @@ -351,7 +351,7 @@ bitflags::bitflags! { /// Trigger the event. const TRIGGER = c::NOTE_TRIGGER; - /// + /// const _ = !0; } } diff --git a/src/fs/at.rs b/src/fs/at.rs index cc614b49d..f40c46ce6 100644 --- a/src/fs/at.rs +++ b/src/fs/at.rs @@ -180,8 +180,8 @@ pub fn linkat( /// `unlinkat(fd, path, flags)`—Unlinks a file or remove a directory. /// -/// With the [`REMOVEDIR`] flag, this removes a directory. This is in place -/// of a `rmdirat` function. +/// With the [`REMOVEDIR`] flag, this removes a directory. This is in place of +/// a `rmdirat` function. /// /// # References /// - [POSIX] diff --git a/src/fs/fcntl.rs b/src/fs/fcntl.rs index 2f2e7e876..f80db849a 100644 --- a/src/fs/fcntl.rs +++ b/src/fs/fcntl.rs @@ -1,7 +1,7 @@ -//! The Unix `fcntl` function is effectively lots of different functions -//! hidden behind a single dynamic dispatch interface. In order to provide -//! a type-safe API, rustix makes them all separate functions so that they -//! can have dedicated static type signatures. +//! The Unix `fcntl` function is effectively lots of different functions hidden +//! behind a single dynamic dispatch interface. In order to provide a type-safe +//! API, rustix makes them all separate functions so that they can have +//! dedicated static type signatures. #[cfg(not(any( target_os = "emscripten", @@ -87,8 +87,8 @@ pub fn fcntl_add_seals(fd: Fd, seals: SealFlags) -> io::Result<()> { /// file should be locked. /// /// Unlike `flock`-style locks, `fcntl`-style locks are process-associated, -/// meaning that they don't guard against being acquired by two threads in -/// the same process. +/// meaning that they don't guard against being acquired by two threads in the +/// same process. /// /// # References /// - [POSIX] diff --git a/src/fs/xattr.rs b/src/fs/xattr.rs index 53612f71f..d5be7a34b 100644 --- a/src/fs/xattr.rs +++ b/src/fs/xattr.rs @@ -15,7 +15,7 @@ bitflags! { /// `XATTR_REPLACE` const REPLACE = c::XATTR_REPLACE as c::c_uint; - /// + /// const _ = !0; } } diff --git a/src/io/fcntl.rs b/src/io/fcntl.rs index 913e9d062..1880ac7db 100644 --- a/src/io/fcntl.rs +++ b/src/io/fcntl.rs @@ -1,10 +1,10 @@ -//! The Unix `fcntl` function is effectively lots of different functions -//! hidden behind a single dynamic dispatch interface. In order to provide -//! a type-safe API, rustix makes them all separate functions so that they -//! can have dedicated static type signatures. +//! The Unix `fcntl` function is effectively lots of different functions hidden +//! behind a single dynamic dispatch interface. In order to provide a type-safe +//! API, rustix makes them all separate functions so that they can have +//! dedicated static type signatures. //! -//! `fcntl` functions which are not specific to files or directories live -//! in the [`io`] module instead. +//! `fcntl` functions which are not specific to files or directories live in +//! the [`io`] module instead. //! //! [`io`]: crate::io diff --git a/src/io/ioctl.rs b/src/io/ioctl.rs index 2362474a0..f89160bf3 100644 --- a/src/io/ioctl.rs +++ b/src/io/ioctl.rs @@ -14,16 +14,8 @@ use backend::fd::AsFd; /// `ioctl(fd, FIOCLEX, NULL)`—Set the close-on-exec flag. /// -/// Also known as `fcntl(fd, F_SETFD, FD_CLOEXEC)`. -/// -/// # References -/// - [Winsock2] -/// - [NetBSD] -/// - [OpenBSD] -/// -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-ioctlsocket -/// [NetBSD]: https://man.netbsd.org/ioctl.2#GENERIC%20IOCTLS -/// [OpenBSD]: https://man.openbsd.org/ioctl.2#GENERIC_IOCTLS +/// This is similar to `fcntl(fd, F_SETFD, FD_CLOEXEC)`, except that it avoids +/// clearing any other flags that might be set. #[cfg(apple)] #[inline] #[doc(alias = "FIOCLEX")] @@ -58,8 +50,8 @@ pub fn ioctl_fionbio(fd: Fd, value: bool) -> io::Result<()> { /// `ioctl(fd, FIONREAD)`—Returns the number of bytes ready to be read. /// -/// The result of this function gets silently coerced into a C `int` -/// by the OS, so it may contain a wrapped value. +/// The result of this function gets silently coerced into a C `int` by the OS, +/// so it may contain a wrapped value. /// /// # References /// - [Linux] diff --git a/src/io_uring.rs b/src/io_uring.rs index eb95678eb..83941922c 100644 --- a/src/io_uring.rs +++ b/src/io_uring.rs @@ -167,7 +167,7 @@ bitflags::bitflags! { /// `IORING_ENTER_REGISTERED_RING` const REGISTERED_RING = sys::IORING_ENTER_REGISTERED_RING; - /// + /// const _ = !0; } } @@ -505,7 +505,7 @@ bitflags::bitflags! { /// `IORING_SETUP_DEFER_TASKRUN` const DEFER_TASKRUN = sys::IORING_SETUP_DEFER_TASKRUN; - /// + /// const _ = !0; } } @@ -536,7 +536,7 @@ bitflags::bitflags! { /// `1 << IOSQE_CQE_SKIP_SUCCESS_BIT` const CQE_SKIP_SUCCESS = 1 << sys::IOSQE_CQE_SKIP_SUCCESS_BIT as u8; - /// + /// const _ = !0; } } @@ -558,7 +558,7 @@ bitflags::bitflags! { /// `IORING_CQE_F_NOTIF` const NOTIF = bitcast!(sys::IORING_CQE_F_NOTIF); - /// + /// const _ = !0; } } @@ -571,7 +571,7 @@ bitflags::bitflags! { /// `IORING_FSYNC_DATASYNC` const DATASYNC = sys::IORING_FSYNC_DATASYNC; - /// + /// const _ = !0; } } @@ -606,7 +606,7 @@ bitflags::bitflags! { /// `IORING_LINK_TIMEOUT_UPDATE` const LINK_TIMEOUT_UPDATE = sys::IORING_LINK_TIMEOUT_UPDATE; - /// + /// const _ = !0; } } @@ -619,7 +619,7 @@ bitflags::bitflags! { /// `SPLICE_F_FD_IN_FIXED` const FD_IN_FIXED = sys::SPLICE_F_FD_IN_FIXED; - /// + /// const _ = !0; } } @@ -632,7 +632,7 @@ bitflags::bitflags! { /// `IORING_MSG_RING_CQE_SKIP` const CQE_SKIP = sys::IORING_MSG_RING_CQE_SKIP; - /// + /// const _ = !0; } } @@ -654,7 +654,7 @@ bitflags::bitflags! { /// `IORING_ASYNC_CANCEL_FD` const FD_FIXED = sys::IORING_ASYNC_CANCEL_FD_FIXED; - /// + /// const _ = !0; } } @@ -703,7 +703,7 @@ bitflags::bitflags! { /// `IORING_FEAT_LINKED_FILE` const LINKED_FILE = sys::IORING_FEAT_LINKED_FILE; - /// + /// const _ = !0; } } @@ -716,7 +716,7 @@ bitflags::bitflags! { /// `IO_URING_OP_SUPPORTED` const SUPPORTED = sys::IO_URING_OP_SUPPORTED as _; - /// + /// const _ = !0; } } @@ -729,7 +729,7 @@ bitflags::bitflags! { /// `IORING_RSRC_REGISTER_SPARSE` const REGISTER_SPARSE = sys::IORING_RSRC_REGISTER_SPARSE as _; - /// + /// const _ = !0; } } @@ -748,7 +748,7 @@ bitflags::bitflags! { /// `IORING_SQ_TASKRUN` const TASKRUN = sys::IORING_SQ_TASKRUN; - /// + /// const _ = !0; } } @@ -761,7 +761,7 @@ bitflags::bitflags! { /// `IORING_CQ_EVENTFD_DISABLED` const EVENTFD_DISABLED = sys::IORING_CQ_EVENTFD_DISABLED; - /// + /// const _ = !0; } } @@ -783,7 +783,7 @@ bitflags::bitflags! { /// `IORING_POLL_ADD_LEVEL` const ADD_LEVEL = sys::IORING_POLL_ADD_LEVEL; - /// + /// const _ = !0; } } @@ -806,7 +806,7 @@ bitflags::bitflags! { /// `IORING_SEND_ZC_REPORT_USAGE` (since Linux 6.2) const ZC_REPORT_USAGE = sys::IORING_SEND_ZC_REPORT_USAGE as _; - /// + /// const _ = !0; } } @@ -829,7 +829,7 @@ bitflags::bitflags! { /// See also [`IoringSendFlags::FIXED_BUF`]. const FIXED_BUF = sys::IORING_RECVSEND_FIXED_BUF as _; - /// + /// const _ = !0; } } @@ -842,7 +842,7 @@ bitflags::bitflags! { /// `IORING_ACCEPT_MULTISHOT` const MULTISHOT = sys::IORING_ACCEPT_MULTISHOT as _; - /// + /// const _ = !0; } } @@ -867,7 +867,7 @@ bitflags::bitflags! { /// `MSG_ERRQUEUE` const ERRQUEUE = net::MSG_ERRQUEUE; - /// + /// const _ = !0; } } diff --git a/src/ioctl/mod.rs b/src/ioctl/mod.rs index 12d680fdc..ce62d75c4 100644 --- a/src/ioctl/mod.rs +++ b/src/ioctl/mod.rs @@ -46,13 +46,16 @@ use bsd as platform; /// controlling their behavior, some of which are proprietary. /// /// This crate exposes many other `ioctl` interfaces with safe and idiomatic -/// wrappers, like [`ioctl_fionbio`](crate::io::ioctl_fionbio) and -/// [`ioctl_fionread`](crate::io::ioctl_fionread). It is recommended to use -/// those instead of this function, as they are safer and more idiomatic. -/// For other cases, implement the [`Ioctl`] API and pass it to this function. +/// wrappers, like [`ioctl_fionbio`] and [`ioctl_fionread`]. It is recommended +/// to use those instead of this function, as they are safer and more +/// idiomatic. For other cases, implement the [`Ioctl`] API and pass it to this +/// function. /// /// See documentation for [`Ioctl`] for more information. /// +/// [`ioctl_fionbio`]: crate::io::ioctl_fionbio +/// [`ioctl_fionread`]: crate::io::ioctl_fionread +/// /// # Safety /// /// While [`Ioctl`] takes much of the unsafety out of `ioctl` calls, it is diff --git a/src/lib.rs b/src/lib.rs index ae0ca455d..03f37d96e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -94,7 +94,7 @@ //! [I/O-safe]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md //! [`Result`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html //! [`Arg`]: https://docs.rs/rustix/*/rustix/path/trait.Arg.html -//! [support for externally defined flags]: https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags +//! [support for externally defined flags]: https://docs.rs/bitflags/*/bitflags/#externally-defined-flags #![deny(missing_docs)] #![allow(stable_features)] diff --git a/src/mm/madvise.rs b/src/mm/madvise.rs index 868a31a5e..4015d1284 100644 --- a/src/mm/madvise.rs +++ b/src/mm/madvise.rs @@ -16,9 +16,9 @@ pub use backend::mm::types::Advice; /// /// # Safety /// -/// `addr` must be a valid pointer to memory that is appropriate to -/// call `posix_madvise` on. Some forms of `advice` may mutate the memory -/// or evoke a variety of side-effects on the mapping and/or the file. +/// `addr` must be a valid pointer to memory that is appropriate to call +/// `posix_madvise` on. Some forms of `advice` may mutate the memory or evoke a +/// variety of side-effects on the mapping and/or the file. /// /// # References /// - [POSIX] diff --git a/src/mm/msync.rs b/src/mm/msync.rs index 0306e36b9..c61d7c379 100644 --- a/src/mm/msync.rs +++ b/src/mm/msync.rs @@ -16,9 +16,9 @@ pub use backend::mm::types::MsyncFlags; /// /// # Safety /// -/// `addr` must be a valid pointer to memory that is appropriate to -/// call `msync` on. Some forms of `msync` may mutate the memory -/// or evoke a variety of side-effects on the mapping and/or the file. +/// `addr` must be a valid pointer to memory that is appropriate to call +/// `msync` on. Some forms of `msync` may mutate the memory or evoke a variety +/// of side-effects on the mapping and/or the file. /// /// # References /// - [POSIX] diff --git a/src/net/send_recv/msg.rs b/src/net/send_recv/msg.rs index b89a9a2c8..ea91cbfec 100644 --- a/src/net/send_recv/msg.rs +++ b/src/net/send_recv/msg.rs @@ -62,9 +62,11 @@ pub const fn __cmsg_space(len: usize) -> usize { #[non_exhaustive] pub enum SendAncillaryMessage<'slice, 'fd> { /// Send file descriptors. + #[doc(alias = "SCM_RIGHTS")] ScmRights(&'slice [BorrowedFd<'fd>]), /// Send process credentials. #[cfg(linux_kernel)] + #[doc(alias = "SCM_CREDENTIAL")] ScmCredentials(UCred), } @@ -85,9 +87,11 @@ impl SendAncillaryMessage<'_, '_> { #[non_exhaustive] pub enum RecvAncillaryMessage<'a> { /// Received file descriptors. + #[doc(alias = "SCM_RIGHTS")] ScmRights(AncillaryIter<'a, OwnedFd>), /// Received process credentials. #[cfg(linux_kernel)] + #[doc(alias = "SCM_CREDENTIALS")] ScmCredentials(UCred), } @@ -741,7 +745,7 @@ mod messages { /// An iterator over the messages in an ancillary buffer. pub(super) struct Messages<'buf> { - /// The message header we're using to iterator over the messages. + /// The message header we're using to iterate over the messages. msghdr: c::msghdr, /// The current pointer to the next message header to return. diff --git a/src/net/sockopt.rs b/src/net/sockopt.rs index 62a985035..afeaf0b33 100644 --- a/src/net/sockopt.rs +++ b/src/net/sockopt.rs @@ -1,7 +1,7 @@ //! `getsockopt` and `setsockopt` functions. //! -//! In the rustix API, there is a separate function for each option, so that -//! it can be given an option-specific type signature. +//! In the rustix API, there is a separate function for each option, so that it +//! can be given an option-specific type signature. //! //! # References for all `get_*` functions: //! diff --git a/src/path/arg.rs b/src/path/arg.rs index dc0893e4b..4a4c8b30f 100644 --- a/src/path/arg.rs +++ b/src/path/arg.rs @@ -36,7 +36,7 @@ use {alloc::string::String, alloc::vec::Vec}; /// This is similar to [`AsRef`]`<`[`Path`]`>`, but is implemented for more /// kinds of strings and can convert into more kinds of strings. /// -/// # Example +/// # Examples /// /// ``` /// # #[cfg(any(feature = "fs", feature = "net"))] diff --git a/src/path/dec_int.rs b/src/path/dec_int.rs index 04c97d406..e9c46f49a 100644 --- a/src/path/dec_int.rs +++ b/src/path/dec_int.rs @@ -22,7 +22,7 @@ use {core::fmt, std::ffi::OsStr, std::path::Path}; /// /// This is used for opening paths such as `/proc/self/fd/` on Linux. /// -/// # Example +/// # Examples /// /// ``` /// # #[cfg(any(feature = "fs", feature = "net"))] diff --git a/src/prctl.rs b/src/prctl.rs index 6aedf3018..0ea83031b 100644 --- a/src/prctl.rs +++ b/src/prctl.rs @@ -26,7 +26,7 @@ bitflags! { /// `PR_PAC_APGAKEY`—Generic authentication `A` key. const GENERIC_AUTHENTICATION_KEY_A = linux_raw_sys::prctl::PR_PAC_APGAKEY; - /// + /// const _ = !0; } } diff --git a/src/process/kill.rs b/src/process/kill.rs index 5f6f06c48..01d5380f8 100644 --- a/src/process/kill.rs +++ b/src/process/kill.rs @@ -19,8 +19,8 @@ pub fn kill_process(pid: Pid, sig: Signal) -> io::Result<()> { /// `kill(-pid, sig)`—Sends a signal to all processes in a process group. /// -/// If `pid` is 1, this sends a signal to all processes the current process -/// has permission to send signals to, except process `1`, possibly other +/// If `pid` is 1, this sends a signal to all processes the current process has +/// permission to send signals to, except process `1`, possibly other /// system-specific processes, and on some systems, the current process. /// /// # References diff --git a/src/process/membarrier.rs b/src/process/membarrier.rs index 9c42bbd85..26be07dd9 100644 --- a/src/process/membarrier.rs +++ b/src/process/membarrier.rs @@ -35,7 +35,7 @@ bitflags::bitflags! { /// `MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ` (since Linux 5.10) const REGISTER_PRIVATE_EXPEDITED_RSEQ = MembarrierCommand::RegisterPrivateExpeditedRseq as _; - /// + /// const _ = !0; } } diff --git a/src/process/pidfd.rs b/src/process/pidfd.rs index 0548055fc..abebaf21f 100644 --- a/src/process/pidfd.rs +++ b/src/process/pidfd.rs @@ -12,7 +12,7 @@ bitflags::bitflags! { /// `PIDFD_NONBLOCK`. const NONBLOCK = backend::c::PIDFD_NONBLOCK; - /// + /// const _ = !0; } } diff --git a/src/process/pidfd_getfd.rs b/src/process/pidfd_getfd.rs index 27d4f1986..4c7696fb6 100644 --- a/src/process/pidfd_getfd.rs +++ b/src/process/pidfd_getfd.rs @@ -18,7 +18,7 @@ bitflags::bitflags! { #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct PidfdGetfdFlags: backend::c::c_uint { - /// + /// const _ = !0; } } diff --git a/src/process/prctl.rs b/src/process/prctl.rs index cb93ad671..830abc13d 100644 --- a/src/process/prctl.rs +++ b/src/process/prctl.rs @@ -149,7 +149,7 @@ bitflags! { #[doc(alias = "PR_UNALIGN_SIGBUS")] const SIGBUS = 2; - /// + /// const _ = !0; } } @@ -410,8 +410,8 @@ const PR_SET_ENDIAN: c_int = 20; /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_SET_ENDIAN,...)`]: https://man7.org/linux/man-pages/man2/prctl.2.html #[inline] @@ -649,8 +649,8 @@ pub enum VirtualMemoryMapAddress { /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_SET_MM,...)`]: https://man7.org/linux/man-pages/man2/prctl.2.html #[inline] @@ -685,8 +685,8 @@ pub fn set_executable_file(fd: BorrowedFd<'_>) -> io::Result<()> { /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_SET_MM,PR_SET_MM_AUXV,...)`]: https://man7.org/linux/man-pages/man2/prctl.2.html #[inline] @@ -1085,8 +1085,8 @@ const PR_PAC_SET_ENABLED_KEYS: c_int = 60; /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_PAC_SET_ENABLED_KEYS,...)`]: https://www.kernel.org/doc/html/v5.18/arm64/pointer-authentication.html #[inline] diff --git a/src/process/procctl.rs b/src/process/procctl.rs index b5b796ea7..f06bd72d6 100644 --- a/src/process/procctl.rs +++ b/src/process/procctl.rs @@ -230,7 +230,7 @@ bitflags! { /// The process is the root of the reaper tree (pid 1). const REALINIT = 2; - /// + /// const _ = !0; } } @@ -494,12 +494,12 @@ const PROC_NO_NEW_PRIVS_CTL: c_int = 19; const PROC_NO_NEW_PRIVS_ENABLE: c_int = 1; -/// Enable the `no_new_privs` mode that ignores SUID and SGID bits -/// on `execve` in the specified process and its future descendants. +/// Enable the `no_new_privs` mode that ignores SUID and SGID bits on `execve` +/// in the specified process and its future descendants. /// -/// This is similar to `set_no_new_privs` on Linux, with the exception -/// that on FreeBSD there is no argument `no_new_privs` argument as it's -/// only possible to enable this mode and there's no going back. +/// This is similar to `set_no_new_privs` on Linux, with the exception that on +/// FreeBSD there is no argument `no_new_privs` argument as it's only possible +/// to enable this mode and there's no going back. /// /// # References /// - [Linux: `prctl(PR_SET_NO_NEW_PRIVS,...)`] diff --git a/src/process/sched.rs b/src/process/sched.rs index 239b7df82..b7dcd58cc 100644 --- a/src/process/sched.rs +++ b/src/process/sched.rs @@ -80,8 +80,8 @@ impl Default for CpuSet { /// `pid` is the thread ID to update. If pid is `None`, then the current thread /// is updated. /// -/// The `CpuSet` argument specifies the set of CPUs on which the thread will -/// be eligible to run. +/// The `CpuSet` argument specifies the set of CPUs on which the thread will be +/// eligible to run. /// /// # References /// - [Linux] diff --git a/src/process/wait.rs b/src/process/wait.rs index 638f958b6..ccb90ae43 100644 --- a/src/process/wait.rs +++ b/src/process/wait.rs @@ -23,7 +23,7 @@ bitflags! { /// [`Signal::Cont`]. const CONTINUED = bitcast!(backend::process::wait::WCONTINUED); - /// + /// const _ = !0; } } @@ -46,7 +46,7 @@ bitflags! { /// Wait for processes that have been stopped. const STOPPED = bitcast!(backend::process::wait::WSTOPPED); - /// + /// const _ = !0; } } @@ -93,8 +93,8 @@ impl WaitStatus { backend::process::wait::WIFCONTINUED(self.0 as _) } - /// Returns the number of the signal that stopped the process, - /// if the process was stopped by a signal. + /// Returns the number of the signal that stopped the process, if the + /// process was stopped by a signal. #[inline] pub fn stopping_signal(self) -> Option { if self.stopped() { @@ -104,8 +104,8 @@ impl WaitStatus { } } - /// Returns the exit status number returned by the process, - /// if it exited normally. + /// Returns the exit status number returned by the process, if it exited + /// normally. #[inline] pub fn exit_status(self) -> Option { if self.exited() { @@ -115,8 +115,8 @@ impl WaitStatus { } } - /// Returns the number of the signal that terminated the process, - /// if the process was terminated by a signal. + /// Returns the number of the signal that terminated the process, if the + /// process was terminated by a signal. #[inline] pub fn terminating_signal(self) -> Option { if self.signaled() { @@ -153,15 +153,15 @@ impl WaitidStatus { self.si_code() == backend::c::CLD_EXITED } - /// Returns whether the process was terminated by a signal - /// and did not create a core file. + /// Returns whether the process was terminated by a signal and did not + /// create a core file. #[inline] pub fn killed(&self) -> bool { self.si_code() == backend::c::CLD_KILLED } - /// Returns whether the process was terminated by a signal - /// and did create a core file. + /// Returns whether the process was terminated by a signal and did create a + /// core file. #[inline] pub fn dumped(&self) -> bool { self.si_code() == backend::c::CLD_DUMPED @@ -173,8 +173,8 @@ impl WaitidStatus { self.si_code() == backend::c::CLD_CONTINUED } - /// Returns the number of the signal that stopped the process, - /// if the process was stopped by a signal. + /// Returns the number of the signal that stopped the process, if the + /// process was stopped by a signal. #[inline] #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "netbsd")))] pub fn stopping_signal(&self) -> Option { @@ -185,8 +185,8 @@ impl WaitidStatus { } } - /// Returns the number of the signal that trapped the process, - /// if the process was trapped by a signal. + /// Returns the number of the signal that trapped the process, if the + /// process was trapped by a signal. #[inline] #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "netbsd")))] pub fn trapping_signal(&self) -> Option { @@ -197,8 +197,8 @@ impl WaitidStatus { } } - /// Returns the exit status number returned by the process, - /// if it exited normally. + /// Returns the exit status number returned by the process, if it exited + /// normally. #[inline] #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "netbsd")))] pub fn exit_status(&self) -> Option { @@ -209,8 +209,8 @@ impl WaitidStatus { } } - /// Returns the number of the signal that terminated the process, - /// if the process was terminated by a signal. + /// Returns the number of the signal that terminated the process, if the + /// process was terminated by a signal. #[inline] #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "netbsd")))] pub fn terminating_signal(&self) -> Option { diff --git a/src/pty.rs b/src/pty.rs index b8d5f5bb1..926ebf789 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -41,7 +41,7 @@ bitflags::bitflags! { #[cfg(any(linux_kernel, target_os = "freebsd", target_os = "netbsd"))] const CLOEXEC = c::O_CLOEXEC as c::c_uint; - /// + /// const _ = !0; } } diff --git a/src/runtime.rs b/src/runtime.rs index c4ea82602..3c754a62f 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -515,7 +515,9 @@ pub fn linux_secure() -> bool { /// /// # Safety /// -/// Be a good sport and don't break the allocator. +/// This is not identical to `brk` in libc. libc `brk` may have bookkeeping +/// that needs to be kept up to date that this doesn't keep up to date, so +/// don't use it unless you are implementing libc. #[cfg(linux_raw)] #[inline] pub unsafe fn brk(addr: *mut c_void) -> io::Result<*mut c_void> { diff --git a/src/static_assertions.rs b/src/static_assertions.rs index 81824cb1c..3d0711811 100644 --- a/src/static_assertions.rs +++ b/src/static_assertions.rs @@ -1,8 +1,7 @@ //! Workarounds for Rust 1.63 where some things in the `static_assertions` -//! crate do things that don't work in const contexts. We want to call them -//! in const contexts in Rust versions where that's supported so that -//! problems are caught at compile time, and fall back to dynamic asserts -//! in Rust 1.63. +//! crate do things that don't work in const contexts. We want to call them in +//! const contexts in Rust versions where that's supported so that problems are +//! caught at compile time, and fall back to dynamic asserts in Rust 1.63. #![allow(unused_macros)] diff --git a/src/termios/types.rs b/src/termios/types.rs index 02f06268f..720352442 100644 --- a/src/termios/types.rs +++ b/src/termios/types.rs @@ -294,7 +294,7 @@ bitflags! { )))] const IUTF8 = c::IUTF8; - /// + /// const _ = !0; } } @@ -509,7 +509,7 @@ bitflags! { )))] const VT1 = c::VT1; - /// + /// const _ = !0; } } @@ -573,7 +573,7 @@ bitflags! { )))] const CMSPAR = c::CMSPAR; - /// + /// const _ = !0; } } @@ -639,7 +639,7 @@ bitflags! { /// `IEXTEN` const IEXTEN = c::IEXTEN; - /// + /// const _ = !0; } } diff --git a/src/thread/libcap.rs b/src/thread/libcap.rs index 19f81a904..0a0fbb4ca 100644 --- a/src/thread/libcap.rs +++ b/src/thread/libcap.rs @@ -103,7 +103,7 @@ bitflags! { /// `CAP_CHECKPOINT_RESTORE` const CHECKPOINT_RESTORE = 1 << linux_raw_sys::general::CAP_CHECKPOINT_RESTORE; - /// + /// const _ = !0; } } diff --git a/src/thread/prctl.rs b/src/thread/prctl.rs index fe2d946db..999764cb1 100644 --- a/src/thread/prctl.rs +++ b/src/thread/prctl.rs @@ -205,8 +205,8 @@ pub enum Capability { /// cleared on successful return from `chown` (not implemented). FileSetID = linux_raw_sys::general::CAP_FSETID, /// Overrides the restriction that the real or effective user ID of a - /// process sending a signal must match the real or effective user ID - /// of the process receiving the signal. + /// process sending a signal must match the real or effective user ID of + /// the process receiving the signal. Kill = linux_raw_sys::general::CAP_KILL, /// Allows `setgid` manipulation. Allows `setgroups`. Allows forged gids on /// socket credentials passing. @@ -444,7 +444,7 @@ bitflags! { /// Set [`NO_CAP_AMBIENT_RAISE`] irreversibly. const NO_CAP_AMBIENT_RAISE_LOCKED = 1_u32 << 7; - /// + /// const _ = !0; } } @@ -756,7 +756,7 @@ bitflags! { /// Asynchronous tag check fault mode. const TCF_ASYNC = 1_u32 << 2; - /// + /// const _ = !0; } } @@ -784,8 +784,8 @@ const PR_SET_TAGGED_ADDR_CTRL: c_int = 55; /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_SET_TAGGED_ADDR_CTRL,...)`]: https://man7.org/linux/man-pages/man2/prctl.2.html #[inline] @@ -813,8 +813,8 @@ const PR_SYS_DISPATCH_OFF: usize = 0; /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_SET_SYSCALL_USER_DISPATCH,PR_SYS_DISPATCH_OFF,...)`]: https://man7.org/linux/man-pages/man2/prctl.2.html #[inline] @@ -859,8 +859,8 @@ impl TryFrom for SysCallUserDispatchFastSwitch { /// /// # Safety /// -/// Please ensure the conditions necessary to safely call this function, -/// as detailed in the references above. +/// Please ensure the conditions necessary to safely call this function, as +/// detailed in the references above. /// /// [`prctl(PR_SET_SYSCALL_USER_DISPATCH,PR_SYS_DISPATCH_ON,...)`]: https://man7.org/linux/man-pages/man2/prctl.2.html #[inline] diff --git a/src/thread/setns.rs b/src/thread/setns.rs index 4568912b2..ef61d11e8 100644 --- a/src/thread/setns.rs +++ b/src/thread/setns.rs @@ -31,7 +31,7 @@ bitflags! { /// Network name space. const NETWORK = CLONE_NEWNET; - /// + /// const _ = !0; } } @@ -86,7 +86,7 @@ bitflags! { /// `CLONE_SYSVSEM`. const SYSVSEM = CLONE_SYSVSEM; - /// + /// const _ = !0; } }