You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Both the name of and the docs for MaybeUninit::uninit_array() make what it actually does somewhat unclear #66845
IIUC you assumed MaybeUninit<[MaybeUninit<T>; N]> as output, but the documented output is [MaybeUninit<T>; N]. I don't think MaybeUninit<[MaybeUninit<T>; N]> is a useful type as an array really is nothing more than its elements, so if those are uninitialized, then the array is already uninitialized as a whole, since there is nothing else besides the elements.
Maybe the "in an uninitialized state" is ambiguous as to whether it refers to the array or the elements though.
Activity
hkBst commentedon Feb 7, 2025
IIUC you assumed
MaybeUninit<[MaybeUninit<T>; N]>as output, but the documented output is[MaybeUninit<T>; N]. I don't thinkMaybeUninit<[MaybeUninit<T>; N]>is a useful type as an array really is nothing more than its elements, so if those are uninitialized, then the array is already uninitialized as a whole, since there is nothing else besides the elements.Maybe the "in an uninitialized state" is ambiguous as to whether it refers to the array or the elements though.
Clarify MaybeUninit docs
Clarify MaybeUninit docs
RalfJung commentedon Feb 21, 2025
You don't have to look at the source for that, the type is right there in the docs. :)
Clarify MaybeUninit docs
Rollup merge of rust-lang#134585 - cyrgani:uninit_array, r=Amanieu
Rollup merge of rust-lang#134585 - cyrgani:uninit_array, r=Amanieu
Unrolled build for rust-lang#134585
Rollup merge of rust-lang#134585 - cyrgani:uninit_array, r=Amanieu
Rollup merge of rust-lang#134585 - cyrgani:uninit_array, r=Amanieu