mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
util: add safety comment to assume_init (#4075)
This commit is contained in:
parent
1e2e38b7cd
commit
8a097d27b5
@ -12,7 +12,13 @@ pub(crate) struct WakeList {
|
||||
impl WakeList {
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
inner: unsafe { MaybeUninit::uninit().assume_init() },
|
||||
inner: unsafe {
|
||||
// safety: Create an uninitialized array of `MaybeUninit`. The
|
||||
// `assume_init` is safe because the type we are claiming to
|
||||
// have initialized here is a bunch of `MaybeUninit`s, which do
|
||||
// not require initialization.
|
||||
MaybeUninit::uninit().assume_init()
|
||||
},
|
||||
curr: 0,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user