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
This is explicitly noted in the MaybeUninit docs as undefined behavior (std::mem:;unintialized was deprecated for a reason!). The correct solution is to store [MaybeUninit<T>; BLOCK_SIZE] in the type, and to only call assume_init() on individual items that are known to be initialized.
(also unrelated: the current implementation of ArrayList<T> is not safe for T that have destructors due to its use of indexed assignment instead of ptr::write. It should have a T: Copy bound to reflect this)
The text was updated successfully, but these errors were encountered:
To make matters even worse, you're using it for NonZero<*mut T>, a type which has invalid bit patterns!
(not that that makes a difference; mem::MaybeUninit::uninit().assume_init() is already undefined behavior for all types! This fact merely makes it... deadlier)
Uh oh!
There was an error while loading. Please reload this page.
pyo3/src/gil.rs
Lines 303 to 306 in 83d0ac4
This is explicitly noted in the MaybeUninit docs as undefined behavior (
std::mem:;unintialized
was deprecated for a reason!). The correct solution is to store[MaybeUninit<T>; BLOCK_SIZE]
in the type, and to only callassume_init()
on individual items that are known to be initialized.(also unrelated: the current implementation of
ArrayList<T>
is not safe for T that have destructors due to its use of indexed assignment instead ofptr::write
. It should have aT: Copy
bound to reflect this)The text was updated successfully, but these errors were encountered: