Skip to content

Commit 33acaa9

Browse files
authored
Miscellaneous documentation cleanups. (#955)
1 parent 7d1e2ef commit 33acaa9

File tree

24 files changed

+76
-71
lines changed

24 files changed

+76
-71
lines changed

examples/stdio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//! A command which prints out information about the standard input,
2-
//! output, and error streams provided to it.
1+
//! A command which prints out information about the standard input, output,
2+
//! and error streams provided to it.
33
44
#[cfg(feature = "termios")]
55
#[cfg(all(not(windows), feature = "stdio"))]

src/backend/libc/event/epoll.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ pub fn wait(epoll: impl AsFd, event_list: &mut EventVec, timeout: c::c_int) -> i
278278
/// An iterator over the `Event`s in an `EventVec`.
279279
pub struct Iter<'a> {
280280
/// Use `Copied` to copy the struct, since `Event` is `packed` on some
281-
/// platforms, and it's common for users to directly destructure it,
282-
/// which would lead to errors about forming references to packed fields.
281+
/// platforms, and it's common for users to directly destructure it, which
282+
/// would lead to errors about forming references to packed fields.
283283
iter: core::iter::Copied<slice::Iter<'a, Event>>,
284284
}
285285

src/backend/libc/event/poll_fd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use {
1212
bitflags! {
1313
/// `POLL*` flags for use with [`poll`].
1414
///
15-
/// [`poll`]: crate::io::poll
15+
/// [`poll`]: crate::event::poll
1616
#[repr(transparent)]
1717
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
1818
pub struct PollFlags: c::c_short {

src/backend/libc/event/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use bitflags::bitflags;
1717
bitflags! {
1818
/// `EFD_*` flags for use with [`eventfd`].
1919
///
20-
/// [`eventfd`]: crate::io::eventfd
20+
/// [`eventfd`]: crate::event::eventfd
2121
#[repr(transparent)]
2222
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
2323
pub struct EventfdFlags: u32 {

src/backend/libc/fs/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ pub(crate) fn ftruncate(fd: BorrowedFd<'_>, length: u64) -> io::Result<()> {
16991699
}
17001700

17011701
#[cfg(any(linux_kernel, target_os = "freebsd"))]
1702-
pub(crate) fn memfd_create(path: &CStr, flags: MemfdFlags) -> io::Result<OwnedFd> {
1702+
pub(crate) fn memfd_create(name: &CStr, flags: MemfdFlags) -> io::Result<OwnedFd> {
17031703
#[cfg(target_os = "freebsd")]
17041704
weakcall! {
17051705
fn memfd_create(
@@ -1716,7 +1716,7 @@ pub(crate) fn memfd_create(path: &CStr, flags: MemfdFlags) -> io::Result<OwnedFd
17161716
) via SYS_memfd_create -> c::c_int
17171717
}
17181718

1719-
unsafe { ret_owned_fd(memfd_create(c_str(path), bitflags_bits!(flags))) }
1719+
unsafe { ret_owned_fd(memfd_create(c_str(name), bitflags_bits!(flags))) }
17201720
}
17211721

17221722
#[cfg(linux_kernel)]

src/backend/libc/mm/types.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ bitflags! {
66
///
77
/// For `PROT_NONE`, use `ProtFlags::empty()`.
88
///
9-
/// [`mmap`]: crate::io::mmap
9+
/// [`mmap`]: crate::mm::mmap
1010
#[repr(transparent)]
1111
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
1212
pub struct ProtFlags: u32 {
@@ -27,7 +27,7 @@ bitflags! {
2727
///
2828
/// For `PROT_NONE`, use `MprotectFlags::empty()`.
2929
///
30-
/// [`mprotect`]: crate::io::mprotect
30+
/// [`mprotect`]: crate::mm::mprotect
3131
#[repr(transparent)]
3232
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
3333
pub struct MprotectFlags: u32 {
@@ -69,8 +69,8 @@ bitflags! {
6969
///
7070
/// For `MAP_ANONYMOUS` (aka `MAP_ANON`), see [`mmap_anonymous`].
7171
///
72-
/// [`mmap`]: crate::io::mmap
73-
/// [`mmap_anonymous`]: crates::io::mmap_anonymous
72+
/// [`mmap`]: crate::mm::mmap
73+
/// [`mmap_anonymous`]: crates::mm::mmap_anonymous
7474
#[repr(transparent)]
7575
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
7676
pub struct MapFlags: u32 {
@@ -242,8 +242,8 @@ bitflags! {
242242
///
243243
/// For `MREMAP_FIXED`, see [`mremap_fixed`].
244244
///
245-
/// [`mremap`]: crate::io::mremap
246-
/// [`mremap_fixed`]: crate::io::mremap_fixed
245+
/// [`mremap`]: crate::mm::mremap
246+
/// [`mremap_fixed`]: crate::mm::mremap_fixed
247247
#[repr(transparent)]
248248
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
249249
pub struct MremapFlags: u32 {
@@ -258,7 +258,7 @@ bitflags! {
258258
bitflags! {
259259
/// `MS_*` flags for use with [`msync`].
260260
///
261-
/// [`msync`]: crate::io::msync
261+
/// [`msync`]: crate::mm::msync
262262
#[repr(transparent)]
263263
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
264264
pub struct MsyncFlags: u32 {
@@ -281,7 +281,7 @@ bitflags! {
281281
bitflags! {
282282
/// `MLOCK_*` flags for use with [`mlock_with`].
283283
///
284-
/// [`mlock_with`]: crate::io::mlock_with
284+
/// [`mlock_with`]: crate::mm::mlock_with
285285
#[repr(transparent)]
286286
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
287287
pub struct MlockFlags: u32 {
@@ -429,7 +429,7 @@ impl Advice {
429429
bitflags! {
430430
/// `O_*` flags for use with [`userfaultfd`].
431431
///
432-
/// [`userfaultfd`]: crate::io::userfaultfd
432+
/// [`userfaultfd`]: crate::mm::userfaultfd
433433
#[repr(transparent)]
434434
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
435435
pub struct UserfaultfdFlags: u32 {

src/backend/libc/pipe/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use {crate::backend::c, bitflags::bitflags};
77
bitflags! {
88
/// `O_*` constants for use with [`pipe_with`].
99
///
10-
/// [`pipe_with`]: crate::io::pipe_with
10+
/// [`pipe_with`]: crate::pipe::pipe_with
1111
#[repr(transparent)]
1212
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
1313
pub struct PipeFlags: u32 {
@@ -34,8 +34,8 @@ bitflags! {
3434

3535
#[cfg(linux_kernel)]
3636
bitflags! {
37-
/// `SPLICE_F_*` constants for use with [`splice`], [`vmsplice`],
38-
/// and [`tee`].
37+
/// `SPLICE_F_*` constants for use with [`splice`], [`vmsplice`], and
38+
/// [`tee`].
3939
#[repr(transparent)]
4040
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
4141
pub struct SpliceFlags: c::c_uint {

src/backend/linux_raw/event/epoll.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ pub fn wait(epoll: impl AsFd, event_list: &mut EventVec, timeout: c::c_int) -> i
262262
/// An iterator over the `Event`s in an `EventVec`.
263263
pub struct Iter<'a> {
264264
/// Use `Copied` to copy the struct, since `Event` is `packed` on some
265-
/// platforms, and it's common for users to directly destructure it,
266-
/// which would lead to errors about forming references to packed fields.
265+
/// platforms, and it's common for users to directly destructure it, which
266+
/// would lead to errors about forming references to packed fields.
267267
iter: core::iter::Copied<slice::Iter<'a, Event>>,
268268
}
269269

src/backend/linux_raw/event/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bitflags::bitflags;
44
bitflags! {
55
/// `EFD_*` flags for use with [`eventfd`].
66
///
7-
/// [`eventfd`]: crate::io::eventfd
7+
/// [`eventfd`]: crate::event::eventfd
88
#[repr(transparent)]
99
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
1010
pub struct EventfdFlags: c::c_uint {

src/backend/linux_raw/mm/syscalls.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
#![allow(unsafe_code)]
77
#![allow(clippy::undocumented_unsafe_blocks)]
88

9-
use super::types::MlockAllFlags;
109
use super::types::{
11-
Advice, MapFlags, MlockFlags, MprotectFlags, MremapFlags, MsyncFlags, ProtFlags,
10+
Advice, MapFlags, MlockAllFlags, MlockFlags, MprotectFlags, MremapFlags, MsyncFlags, ProtFlags,
1211
UserfaultfdFlags,
1312
};
1413
use crate::backend::c;

0 commit comments

Comments
 (0)