Skip to content

Commit 3fb04ee

Browse files
authored
Work around a Rust 1.69 doc bug. (#819)
Don't add documentation to public type aliases `Errno` and `GetRandomFlags`; just document the underlying types instead. This avoids a compiler abort in Rust 1.69. Fixes #818.
1 parent 1c1af76 commit 3fb04ee

5 files changed

Lines changed: 51 additions & 33 deletions

File tree

src/backend/libc/io/errno.rs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,32 @@
66
use crate::backend::c;
77
use libc_errno::errno;
88

9-
/// The error type for `rustix` APIs.
9+
/// `errno`—An error code.
1010
///
11-
/// This is similar to `std::io::Error`, but only holds an OS error code,
12-
/// and no extra error value.
11+
/// The error type for `rustix` APIs. This is similar to [`std::io::Error`],
12+
//// but only holds an OS error code, and no extra error value.
13+
///
14+
/// # References
15+
/// - [POSIX]
16+
/// - [Linux]
17+
/// - [Winsock2]
18+
/// - [FreeBSD]
19+
/// - [NetBSD]
20+
/// - [OpenBSD]
21+
/// - [DragonFly BSD]
22+
/// - [illumos]
23+
/// - [glibc]
24+
///
25+
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html
26+
/// [Linux]: https://man7.org/linux/man-pages/man3/errno.3.html
27+
/// [Winsock2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
28+
/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?errno
29+
/// [NetBSD]: https://man.netbsd.org/errno.2
30+
/// [OpenBSD]: https://man.openbsd.org/errno.2
31+
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=errno&section=2
32+
/// [illumos]: https://illumos.org/man/3C/errno
33+
/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
34+
/// [`std::io::Error`]: Result
1335
#[repr(transparent)]
1436
#[doc(alias = "errno")]
1537
#[derive(Eq, PartialEq, Hash, Copy, Clone)]

src/backend/linux_raw/io/errno.rs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,32 @@ use crate::backend::reg::{RetNumber, RetReg};
1616
use crate::io;
1717
use linux_raw_sys::errno;
1818

19-
/// The error type for `rustix` APIs.
19+
/// `errno`—An error code.
2020
///
21-
/// This is similar to `std::io::Error`, but only holds an OS error code,
22-
/// and no extra error value.
21+
/// The error type for `rustix` APIs. This is similar to [`std::io::Error`],
22+
//// but only holds an OS error code, and no extra error value.
23+
///
24+
/// # References
25+
/// - [POSIX]
26+
/// - [Linux]
27+
/// - [Winsock2]
28+
/// - [FreeBSD]
29+
/// - [NetBSD]
30+
/// - [OpenBSD]
31+
/// - [DragonFly BSD]
32+
/// - [illumos]
33+
/// - [glibc]
34+
///
35+
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html
36+
/// [Linux]: https://man7.org/linux/man-pages/man3/errno.3.html
37+
/// [Winsock2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
38+
/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?errno
39+
/// [NetBSD]: https://man.netbsd.org/errno.2
40+
/// [OpenBSD]: https://man.openbsd.org/errno.2
41+
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=errno&section=2
42+
/// [illumos]: https://illumos.org/man/3C/errno
43+
/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
44+
/// [`std::io::Error`]: Result
2345
#[repr(transparent)]
2446
#[doc(alias = "errno")]
2547
#[derive(Eq, PartialEq, Hash, Copy, Clone)]

src/fs/at.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! The `dirfd` argument to these functions may be a file descriptor for a
44
//! directory, or the special value [`CWD`].
55
//!
6-
//! [`cwd`]: crate::fs::cwd::CWD
6+
//! [`cwd`]: crate::fs::CWD
77
88
use crate::fd::OwnedFd;
99
#[cfg(apple)]

src/io/errno.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,6 @@ use std::error;
1212
/// A specialized [`Result`] type for `rustix` APIs.
1313
pub type Result<T> = result::Result<T, Errno>;
1414

15-
/// `errno`—An error code.
16-
///
17-
/// The error type for `rustix` APIs. This is similar to [`std::io::Error`],
18-
/// but only holds an OS error code, and no extra error value.
19-
///
20-
/// # References
21-
/// - [POSIX]
22-
/// - [Linux]
23-
/// - [Winsock2]
24-
/// - [FreeBSD]
25-
/// - [NetBSD]
26-
/// - [OpenBSD]
27-
/// - [DragonFly BSD]
28-
/// - [illumos]
29-
/// - [glibc]
30-
///
31-
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html
32-
/// [Linux]: https://man7.org/linux/man-pages/man3/errno.3.html
33-
/// [Winsock2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
34-
/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?errno
35-
/// [NetBSD]: https://man.netbsd.org/errno.2
36-
/// [OpenBSD]: https://man.openbsd.org/errno.2
37-
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=errno&section=2
38-
/// [illumos]: https://illumos.org/man/3C/errno
39-
/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
4015
pub use backend::io::errno::Errno;
4116

4217
impl Errno {

src/rand/getrandom.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::{backend, io};
22

3-
/// `GRND_*` constants for use with [`getrandom`].
43
pub use backend::rand::types::GetRandomFlags;
54

65
/// `getrandom(buf, flags)`—Reads a sequence of random bytes.

0 commit comments

Comments
 (0)