pub unsafe fn boxed_deleter<T: ?Sized>(ptr: *mut T)Expand description
Default Rust deleter.
Invokes destructor and de-allocates memory using global allocator, using Box.
It can be useful when one would want to allow type erasure,
but it is UB to specify invalid T
use smart_ptr::Unique;
let var = Box::new("test".to_string());
unsafe {
smart_ptr::boxed_deleter::<String>(Box::leak(var) as *mut String);
}ยงWarning
Remember that things can get complicated when you cast from fat ptrs(with vtable)