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
However, there is no way to extract the allocator while leaking without using the underlying Box::into_raw_with_allocator, which returns (*mut T, A). I propose adding Box::leak_with_allocator, which returns (&mut T, A) by calling into_raw_with_allocator and performing the unsafe cast.
Any thoughts on this? Happy to make a PR if this is something that others think is a good idea.
The text was updated successfully, but these errors were encountered:
Box::leak is defined as
However, there is no way to extract the allocator while leaking without using the underlying
Box::into_raw_with_allocator
, which returns(*mut T, A)
. I propose addingBox::leak_with_allocator
, which returns(&mut T, A)
by callinginto_raw_with_allocator
and performing the unsafe cast.Any thoughts on this? Happy to make a PR if this is something that others think is a good idea.
The text was updated successfully, but these errors were encountered: