#Type for uninitialized unsized allocations

1 messages · Page 1 of 1 (latest)

vast smelt
#

working on an allocator (not allocator-api) and wanted a method that can allocate slice-based DSTs (anything shaped like struct Example{ ..., slice: [u8] }) without performing initialization. as i understand, there's no way to do MaybeUninit<T: ?Sized>, so i came up with my own UnsizedMaybeUninit<T: SliceDst + ?Sized> for use specifically with slice DSTs. i think it's sound (barring assuming without initializing) but i'm really not sure and would appreciate an extra pair of eyes on it

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=2cbf52b12872a051fe62ca907db15be8

austere wasp
vast smelt
#

this looks way simpler than what i had :)

#

i'm testing it out in my project but it looks great