Skip to content

Commit b726837

Browse files
authored
Fix some TODOs in the CI rules. (#1149)
* Fix some TODOs in the CI rules. * Fix warnings.
1 parent eb9f634 commit b726837

File tree

3 files changed

+57
-29
lines changed

3 files changed

+57
-29
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ jobs:
3737
os: ubuntu-latest
3838
rust: 1.63
3939

40-
# TODO: Reenable this once we can remove the redundant `Vec` imports.
41-
#env:
42-
# # -D warnings is commented out in our install-rust action; re-add it here.
43-
# RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths --cfg criterion
40+
env:
41+
# -D warnings is commented out in our install-rust action; re-add it here.
42+
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths --cfg criterion
4443
steps:
4544
- uses: actions/checkout@v4
4645
with:
@@ -135,10 +134,9 @@ jobs:
135134
os: ubuntu-latest
136135
rust: nightly
137136

138-
# TODO: Reenable this once we can remove the redundant `Vec` imports.
139-
#env:
140-
# # -D warnings is commented out in our install-rust action; re-add it here.
141-
# RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
137+
env:
138+
# -D warnings is commented out in our install-rust action; re-add it here.
139+
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
142140
steps:
143141
- uses: actions/checkout@v4
144142
with:
@@ -558,8 +556,7 @@ jobs:
558556
qemu_target: arm-linux-user
559557
env:
560558
# -D warnings is commented out in our install-rust action; re-add it here.
561-
# TODO: Reenable this once we can remove the redundant `Vec` imports.
562-
#RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
559+
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
563560
QEMU_BUILD_VERSION: 8.1.2
564561
steps:
565562
- uses: actions/checkout@v4
@@ -649,9 +646,7 @@ jobs:
649646
qemu_target: ppc64le-linux-user
650647
env:
651648
# -D warnings is commented out in our install-rust action; re-add it here.
652-
# TODO: Reenable this once we can remove the redundant `Vec` imports.
653-
#RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings -D elided-lifetimes-in-paths
654-
RUSTFLAGS: --cfg rustix_use_experimental_asm
649+
RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings -D elided-lifetimes-in-paths
655650
RUSTDOCFLAGS: --cfg rustix_use_experimental_asm
656651
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
657652
QEMU_BUILD_VERSION: 8.1.2

src/backend/libc/event/syscalls.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
//! libc syscalls supporting `rustix::event`.
22
33
use crate::backend::c;
4+
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
5+
use crate::backend::conv::ret;
6+
use crate::backend::conv::ret_c_int;
7+
#[cfg(feature = "alloc")]
48
#[cfg(any(linux_kernel, target_os = "redox"))]
59
use crate::backend::conv::ret_u32;
6-
use crate::backend::conv::{borrowed_fd, ret, ret_c_int, ret_owned_fd};
710
#[cfg(solarish)]
811
use crate::event::port::Event;
912
#[cfg(any(
@@ -14,14 +17,36 @@ use crate::event::port::Event;
1417
))]
1518
use crate::event::EventfdFlags;
1619
use crate::event::PollFd;
17-
use crate::fd::{BorrowedFd, OwnedFd};
1820
use crate::io;
1921
#[cfg(solarish)]
2022
use crate::utils::as_mut_ptr;
2123
#[cfg(any(linux_kernel, target_os = "redox"))]
2224
use crate::utils::as_ptr;
25+
#[cfg(any(
26+
all(feature = "alloc", bsd),
27+
solarish,
28+
all(feature = "alloc", any(linux_kernel, target_os = "redox")),
29+
))]
2330
use core::mem::MaybeUninit;
31+
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
2432
use core::ptr::null_mut;
33+
#[cfg(any(
34+
linux_kernel,
35+
solarish,
36+
target_os = "redox",
37+
all(feature = "alloc", bsd)
38+
))]
39+
use {crate::backend::conv::borrowed_fd, crate::fd::BorrowedFd};
40+
#[cfg(any(
41+
linux_kernel,
42+
solarish,
43+
target_os = "freebsd",
44+
target_os = "illumos",
45+
target_os = "espidf",
46+
target_os = "redox",
47+
all(feature = "alloc", bsd)
48+
))]
49+
use {crate::backend::conv::ret_owned_fd, crate::fd::OwnedFd};
2550
#[cfg(all(feature = "alloc", bsd))]
2651
use {crate::event::kqueue::Event, crate::utils::as_ptr, core::ptr::null};
2752

@@ -249,6 +274,7 @@ pub(crate) fn epoll_del(epoll: BorrowedFd<'_>, source: BorrowedFd<'_>) -> io::Re
249274
}
250275

251276
#[inline]
277+
#[cfg(feature = "alloc")]
252278
#[cfg(any(linux_kernel, target_os = "redox"))]
253279
pub(crate) fn epoll_wait(
254280
epoll: BorrowedFd<'_>,

src/backend/libc/thread/syscalls.rs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
use crate::backend::c;
44
use crate::backend::conv::ret;
55
use crate::io;
6+
#[cfg(not(any(
7+
apple,
8+
freebsdlike,
9+
target_os = "emscripten",
10+
target_os = "espidf",
11+
target_os = "haiku",
12+
target_os = "openbsd",
13+
target_os = "redox",
14+
target_os = "vita",
15+
target_os = "wasi",
16+
)))]
17+
use crate::thread::ClockId;
618
#[cfg(not(target_os = "redox"))]
719
use crate::thread::{NanosleepRelativeResult, Timespec};
820
#[cfg(all(target_env = "gnu", fix_y2038))]
@@ -24,18 +36,6 @@ use {
2436
crate::thread::futex,
2537
crate::utils::as_mut_ptr,
2638
};
27-
#[cfg(not(any(
28-
apple,
29-
freebsdlike,
30-
target_os = "emscripten",
31-
target_os = "espidf",
32-
target_os = "haiku",
33-
target_os = "openbsd",
34-
target_os = "redox",
35-
target_os = "vita",
36-
target_os = "wasi",
37-
)))]
38-
use {crate::thread::ClockId, core::ptr::null_mut};
3939

4040
#[cfg(all(target_env = "gnu", fix_y2038))]
4141
weak!(fn __clock_nanosleep_time64(c::clockid_t, c::c_int, *const LibcTimespec, *mut LibcTimespec) -> c::c_int);
@@ -173,7 +173,7 @@ pub(crate) fn clock_nanosleep_absolute(id: ClockId, request: &Timespec) -> io::R
173173
id as c::clockid_t,
174174
flags,
175175
&request.clone().into(),
176-
null_mut(),
176+
core::ptr::null_mut(),
177177
)
178178
} {
179179
0 => Ok(()),
@@ -190,7 +190,14 @@ pub(crate) fn clock_nanosleep_absolute(id: ClockId, request: &Timespec) -> io::R
190190
{
191191
let flags = c::TIMER_ABSTIME;
192192

193-
match unsafe { c::clock_nanosleep(id as c::clockid_t, flags as _, request, null_mut()) } {
193+
match unsafe {
194+
c::clock_nanosleep(
195+
id as c::clockid_t,
196+
flags as _,
197+
request,
198+
core::ptr::null_mut(),
199+
)
200+
} {
194201
0 => Ok(()),
195202
err => Err(io::Errno(err)),
196203
}

0 commit comments

Comments
 (0)