Skip to content

Commit

Permalink
Fix a new dead_code warning. (#981)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
sunfishcode committed Jan 11, 2024
1 parent 3652dc0 commit 9095854
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/libc/time/syscalls.rs
Expand Up @@ -167,8 +167,8 @@ pub(crate) fn clock_gettime_dynamic(id: DynamicClockId<'_>) -> io::Result<Timesp
DynamicClockId::Tai => c::CLOCK_TAI,

#[cfg(any(
freebsdlike,
linux_kernel,
target_os = "freebsd",
target_os = "fuchsia",
target_os = "openbsd"
))]
Expand Down
1 change: 1 addition & 0 deletions src/backend/linux_raw/reg.rs
Expand Up @@ -45,6 +45,7 @@ pub(super) trait FromAsm: private::Sealed {
/// pointer types. They need a type to point to, so we define a custom private
/// type, to prevent it from being used for anything else.
#[repr(transparent)]
#[allow(dead_code)]
pub(super) struct Opaque(c::c_void);

// Argument numbers.
Expand Down
2 changes: 1 addition & 1 deletion src/clockid.rs
Expand Up @@ -149,8 +149,8 @@ pub enum DynamicClockId<'a> {

/// `CLOCK_BOOTTIME`
#[cfg(any(
freebsdlike,
linux_kernel,
target_os = "freebsd",
target_os = "fuchsia",
target_os = "openbsd"
))]
Expand Down
2 changes: 1 addition & 1 deletion tests/time/clocks.rs
Expand Up @@ -8,8 +8,8 @@ use rustix::time::{clock_gettime, ClockId};
/// Attempt to test that the boot clock is monotonic. Time may or may not
/// advance, but it shouldn't regress.
#[cfg(any(
freebsdlike,
linux_kernel,
target_os = "freebsd",
target_os = "fuchsia",
target_os = "openbsd"
))]
Expand Down

0 comments on commit 9095854

Please sign in to comment.