What are the guarantees for interoperability for different functionality within the alloc
crate? Is this code valid forever?
fn free<'a, T: ?Sized + 'a>(val: Box<T>) {
use std::{alloc, mem, ptr};
unsafe {
let p = Box::into_raw(val);
let layout = alloc::Layout::for_value(&*p);
ptr::drop_in_place(p);
alloc::dealloc(p as _, layout);
}
}