Skip to content

Commit 156e6f4

Browse files
authored
Miscellaneous cleanups. (#1380)
1 parent fa5c3df commit 156e6f4

File tree

14 files changed

+38
-32
lines changed

14 files changed

+38
-32
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ jobs:
220220
- run: cargo check -Z build-std --target aarch64-unknown-linux-gnu_ilp32 --all-targets --features=all-apis
221221
- run: cargo check -Z build-std --target x86_64-unknown-haiku --all-targets --features=all-apis
222222
- run: cargo check -Z build-std --target x86_64-uwp-windows-msvc --all-targets --features=all-apis
223-
# Temporarily disable riscv32imc-esp-espidf, as it gets build errors.
224-
# - run: cargo check -Z build-std --target=riscv32imc-esp-espidf --features=all-apis
223+
- run: cargo check -Z build-std --target=riscv32imc-esp-espidf --features=all-apis
225224
- run: cargo check -Z build-std --target=aarch64-unknown-nto-qnx710 --features=all-apis
226225
- run: cargo check -Z build-std --target=x86_64-pc-nto-qnx710 --features=all-apis
227226
- run: cargo check -Z build-std --target=armv6k-nintendo-3ds --all-features

src/backend/libc/fs/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ pub(crate) fn fadvise(
12871287
// also avoid exposing this artifact of casting an unsigned value to the
12881288
// signed type. To do this, we use a no-op call in this case.
12891289
//
1290-
// [Rust convention]: https://doc.rust-lang.org/stable/std/io/enum.SeekFrom.html#variant.Start
1290+
// [Rust convention]: std::io::SeekFrom::Start
12911291
#[cfg(target_os = "freebsd")]
12921292
if offset < 0 {
12931293
if len < 0 {

src/backend/libc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub(crate) mod fd {
2727
pub trait AsRawFd {
2828
/// A version of [`as_raw_fd`] for use with Winsock API.
2929
///
30-
/// [`as_raw_fd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.FromRawFd.html#tymethod.as_raw_fd
30+
/// [`as_raw_fd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.AsRawFd.html#tymethod.as_raw_fd
3131
fn as_raw_fd(&self) -> RawFd;
3232
}
3333
impl<T: AsRawSocket> AsRawFd for T {
@@ -43,7 +43,7 @@ pub(crate) mod fd {
4343
pub trait IntoRawFd {
4444
/// A version of [`into_raw_fd`] for use with Winsock API.
4545
///
46-
/// [`into_raw_fd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.FromRawFd.html#tymethod.into_raw_fd
46+
/// [`into_raw_fd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.IntoRawFd.html#tymethod.into_raw_fd
4747
fn into_raw_fd(self) -> RawFd;
4848
}
4949
impl<T: IntoRawSocket> IntoRawFd for T {

src/backend/linux_raw/param/libc_auxv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub(crate) fn linux_secure() -> bool {
154154
#[inline]
155155
pub(crate) fn exe_phdrs() -> (*const c::c_void, usize, usize) {
156156
unsafe {
157-
let phdr = getauxval(AT_PHDR) as *const c::c_void;
157+
let phdr: *const c::c_void = getauxval(AT_PHDR);
158158
let phent = getauxval(AT_PHENT) as usize;
159159
let phnum = getauxval(AT_PHNUM) as usize;
160160
(phdr, phent, phnum)

src/backend/linux_raw/runtime/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub(crate) unsafe fn kernel_fork() -> io::Result<Fork> {
4141
//
4242
// Architectures differ on the order of the parameters.
4343
#[cfg(target_arch = "x86_64")]
44-
let pid = ret_c_int(syscall_readonly!(
44+
let pid = ret_c_int(syscall!(
4545
__NR_clone,
4646
c_int(c::SIGCHLD | c::CLONE_CHILD_SETTID),
4747
zero(),
@@ -62,7 +62,7 @@ pub(crate) unsafe fn kernel_fork() -> io::Result<Fork> {
6262
target_arch = "s390x",
6363
target_arch = "x86"
6464
))]
65-
let pid = ret_c_int(syscall_readonly!(
65+
let pid = ret_c_int(syscall!(
6666
__NR_clone,
6767
c_int(c::SIGCHLD | c::CLONE_CHILD_SETTID),
6868
zero(),

src/io/dup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ pub fn dup<Fd: AsFd>(fd: Fd) -> io::Result<OwnedFd> {
8181
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=dup2&section=2
8282
/// [illumos]: https://illumos.org/man/2/dup
8383
/// [glibc]: https://sourceware.org/glibc/manual/latest/html_node/Duplicating-Descriptors.html
84-
/// [`stdio::dup2_stdin`]: https://docs.rs/rustix/*/rustix/stdio/fn.dup2_stdin.html
85-
/// [`stdio::dup2_stdout`]: https://docs.rs/rustix/*/rustix/stdio/fn.dup2_stdout.html
86-
/// [`stdio::dup2_stderr`]: https://docs.rs/rustix/*/rustix/stdio/fn.dup2_stderr.html
84+
/// [`stdio::dup2_stdin`]: crate::stdio::dup2_stdin
85+
/// [`stdio::dup2_stdout`]: crate::stdio::dup2_stdout
86+
/// [`stdio::dup2_stderr`]: crate::stdio::dup2_stderr
8787
#[cfg(not(target_os = "wasi"))]
8888
#[inline]
8989
pub fn dup2<Fd: AsFd>(fd: Fd, new: &mut OwnedFd) -> io::Result<()> {

src/io/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! I/O operations.
22
//!
3-
//! If you're looking for [`SeekFrom`], that's in the [`fs`] module.
3+
//! If you're looking for [`SeekFrom`], it's in the [`fs`] module.
44
//!
5-
//! [`SeekFrom`]: https://docs.rs/rustix/*/rustix/fs/enum.SeekFrom.html
6-
//! [`fs`]: https://docs.rs/rustix/*/rustix/fs/index.html
5+
//! [`SeekFrom`]: crate::fs::SeekFrom
6+
//! [`fs`]: crate::fs
77
88
mod close;
99
#[cfg(not(windows))]

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@
9494
//! [`AsFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.AsFd.html
9595
//! [`OwnedFd`]: https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html
9696
//! [I/O-safe]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
97-
//! [`Result`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html
98-
//! [`Arg`]: https://docs.rs/rustix/*/rustix/path/trait.Arg.html
97+
//! [`Arg`]: path::Arg
9998
//! [support for externally defined flags]: https://docs.rs/bitflags/*/bitflags/#externally-defined-flags
10099
101100
#![deny(missing_docs)]

src/not_implemented.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ macro_rules! not_implemented {
2525
///
2626
/// [dlmalloc]: https://crates.io/crates/dlmalloc
2727
/// [talc]: https://crates.io/crates/talc
28-
/// [rustix-dlmalloc]: https://github.com/sunfishcode/rustix-dlmalloc
28+
/// [rustix-dlmalloc]: https://crates.io/crates/rustix-dlmalloc
2929
pub mod memory_allocation {
3030
not_implemented!(malloc);
3131
not_implemented!(realloc);
@@ -223,15 +223,15 @@ pub mod higher_level {
223223
not_implemented!(execvpe);
224224
not_implemented!(wordexp);
225225

226-
/// See [rustix-openpty](https://github.com/sunfishcode/rustix-openpty).
226+
/// See [rustix-openpty](https://crates.io/crates/rustix-openpty).
227227
pub fn closefrom() {
228228
unimplemented!()
229229
}
230-
/// See [rustix-openpty](https://github.com/sunfishcode/rustix-openpty).
230+
/// See [rustix-openpty](https://crates.io/crates/rustix-openpty).
231231
pub fn login_tty() {
232232
unimplemented!()
233233
}
234-
/// See [rustix-openpty](https://github.com/sunfishcode/rustix-openpty).
234+
/// See [rustix-openpty](https://crates.io/crates/rustix-openpty).
235235
pub fn openpty() {
236236
unimplemented!()
237237
}
@@ -241,9 +241,9 @@ pub mod higher_level {
241241
/// For Rust < 1.70, see [is-terminal]. For a rustix-based implementation,
242242
/// see [rustix-is-terminal].
243243
///
244-
/// [`std::io::IsTerminal`]: https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html
244+
/// [`std::io::IsTerminal`]: std::io::IsTerminal
245245
/// [is-terminal]: https://crates.io/crates/is-terminal
246-
/// [rustix-is-terminal]: https://github.com/sunfishcode/rustix-is-terminal
246+
/// [rustix-is-terminal]: https://crates.io/crates/rustix-is-terminal
247247
pub fn isatty() {
248248
unimplemented!()
249249
}

src/process/ioctl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ unsafe impl ioctl::Ioctl for Tiocsctty {
6161
}
6262

6363
fn as_ptr(&mut self) -> *mut c::c_void {
64-
(&0_u32) as *const u32 as *mut c::c_void
64+
crate::utils::as_ptr(&0_u32) as *mut c::c_void
6565
}
6666

6767
unsafe fn output_from_ptr(

0 commit comments

Comments
 (0)