Realloc Layout for Box<[MaybeUninit]>?
⚓ Rust 📅 2025-05-30 👤 surdeus 👁️ 11I'd like to take a Box<[MaybeUninit<T>]>, take the raw pointer out of it, and reallocate it. However, my specific concern is that the realloc method specifies that:
layoutis the same layout that was used to allocate that block of memory
If the Box was created via new_uninit_slice, is it safe to assume that Layout::array::<T>(box.len()) is the correct Layout builder to use for reallocating?
1 post - 1 participant
🏷️ rust_feed