Infinite loop when trying to fill a Vector of MaybeUninit<SomeZeroSizedType> #80747
Labels
A-collections
Area: std::collections.
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I tried to reduce the demonstration to the minimum possible.
I wrote a function that fills a vector of
MaybeUninit<T>
values that I think is safe (free of UB).The code works well with
cargo miri run
.But when calling this function with a zero-sized type, the execution goes into an infinite loop.
The exact same code without the
MaybeUninit
logic works as expected.Here is the code:
(Playground)
Output:
The text was updated successfully, but these errors were encountered: