File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ use std::time::Duration;
99use std:: { cmp, fmt, ops} ;
1010
1111const 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.
12+ // TODO(MSRV>=1.75, feature(const_maybe_uninit_zeroed): use [`std::mem::MaybeUninit::zeroed()`]
1513 unsafe { std:: mem:: transmute ( [ 0u8 ; std:: mem:: size_of :: < timespec > ( ) ] ) }
1614}
1715
@@ -33,7 +31,7 @@ pub(crate) mod timer {
3331 use bitflags:: bitflags;
3432
3533 #[ derive( Debug , Clone , Copy ) ]
36- pub ( crate ) struct TimerSpec ( libc:: itimerspec ) ;
34+ pub ( crate ) struct TimerSpec ( MaybeUninit < libc:: itimerspec > ) ;
3735
3836 impl TimerSpec {
3937 pub const fn none ( ) -> Self {
You can’t perform that action at this time.
0 commit comments