We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b44fd1a commit 9aea929Copy full SHA for 9aea929
src/sys/time.rs
@@ -9,9 +9,7 @@ use std::time::Duration;
9
use std::{cmp, fmt, ops};
10
11
const fn zero_init_timespec() -> timespec {
12
- // `std::mem::MaybeUninit::zeroed()` is not yet a const fn
13
- // (https://github.com/rust-lang/rust/issues/91850) so we will instead initialize an array of
14
- // the appropriate size to zero and then transmute it to a timespec value.
+ // TODO(MSRV>=1.75, feature(const_maybe_uninit_zeroed): use [`std::mem::MaybeUninit::zeroed()`]
15
unsafe { std::mem::transmute([0u8; std::mem::size_of::<timespec>()]) }
16
}
17
0 commit comments