Skip to content

Commit 996511a

Browse files
oherralaThomasdezeeuw
authored andcommitted
Fix breaking tests due to libc's deprecation of Musl time_t
Musl 1.2 has switched to 64 bit time_t, and libc crate is giving deprecation warning about it on Musl targets. This PR silences that this warnings so that it doesn't break tests. libc issue: rust-lang/libc#1848
1 parent b1479ff commit 996511a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sys/unix.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ pub(crate) fn set_timeout_opt(
769769

770770
fn into_timeval(duration: Option<Duration>) -> libc::timeval {
771771
match duration {
772+
// https://github.com/rust-lang/libc/issues/1848
773+
#[cfg_attr(target_env = "musl", allow(deprecated))]
772774
Some(duration) => libc::timeval {
773775
tv_sec: min(duration.as_secs(), libc::time_t::max_value() as u64) as libc::time_t,
774776
tv_usec: duration.subsec_micros() as libc::suseconds_t,

0 commit comments

Comments
 (0)