-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-arrayArea: `[T; N]`Area: `[T; N]`A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Basically, based on the name of the function, and also the part of the docs for it that says:
Create a new array of MaybeUninit<T> items, in an uninitialized state.
I initially had the impression that it internally amounted to:
MaybeUninit::<[MaybeUninit<T>; LEN]>::uninit()
and returned an uninitialized array of uninitialized MaybeUninits.
However, after looking at the source, I realized it actually amounts to:
MaybeUninit::<[MaybeUninit<T>; LEN]>::uninit().assume_init()
and returns an initialized array of uninitialized MaybeUninits (which is what I actually needed, so that's good at least!)
luojia65
Metadata
Metadata
Assignees
Labels
A-arrayArea: `[T; N]`Area: `[T; N]`A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.