-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move_into: Add conversion .into_maybe_uninit() for array views
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ugh, this can't be allowed to be a safe function.
If we have an
Array1<Option<&i32>>
and make anArrayViewMut1<MaybeUninit<Option<&i32>>
from it, we can fill it withuninit
orzeroed
elements in safe code, which ends up messing up the originalArray1
. 🙁(Something in type theory about mutability leading to that the type constructor having to be invariant.. something like that.)