Skip to content

Commit 9095854

Browse files
authored
Fix a new dead_code warning. (#981)
* Fix a new `dead_code` warning. * Fix breakage caused by `CLOCK_BOOTTIME` being removed from DragonFly. rust-lang/libc#3509 removed `CLOCK_BOOTIME` from DragonFly, which broke rustix.
1 parent 3652dc0 commit 9095854

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

src/backend/libc/time/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ pub(crate) fn clock_gettime_dynamic(id: DynamicClockId<'_>) -> io::Result<Timesp
167167
DynamicClockId::Tai => c::CLOCK_TAI,
168168

169169
#[cfg(any(
170-
freebsdlike,
171170
linux_kernel,
171+
target_os = "freebsd",
172172
target_os = "fuchsia",
173173
target_os = "openbsd"
174174
))]

src/backend/linux_raw/reg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub(super) trait FromAsm: private::Sealed {
4545
/// pointer types. They need a type to point to, so we define a custom private
4646
/// type, to prevent it from being used for anything else.
4747
#[repr(transparent)]
48+
#[allow(dead_code)]
4849
pub(super) struct Opaque(c::c_void);
4950

5051
// Argument numbers.

src/clockid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ pub enum DynamicClockId<'a> {
149149

150150
/// `CLOCK_BOOTTIME`
151151
#[cfg(any(
152-
freebsdlike,
153152
linux_kernel,
153+
target_os = "freebsd",
154154
target_os = "fuchsia",
155155
target_os = "openbsd"
156156
))]

tests/time/clocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use rustix::time::{clock_gettime, ClockId};
88
/// Attempt to test that the boot clock is monotonic. Time may or may not
99
/// advance, but it shouldn't regress.
1010
#[cfg(any(
11-
freebsdlike,
1211
linux_kernel,
12+
target_os = "freebsd",
1313
target_os = "fuchsia",
1414
target_os = "openbsd"
1515
))]

0 commit comments

Comments
 (0)